Preface
Jquery has developed to this day, and the slide components are very mature, so the following editor will take you to take a look at the steps to use Angularjs to achieve slide effects.
npm installation
npm install angularjsSlider
How to use
Step 1 (Introduction)
require('angularjsSlider')(moduleName);//IntroduceStep 2 (parameter configuration)
| type | illustrate | |
| data | Array | Slide picture data [{img: "1.jpg",link:'#'}...] |
| timer | Number | Slide switch interval timer="2" |
| btn-left | String | left toggle button btn-left="#btnleft" |
| btn-right | String | Toggle button btn-right=".btnright" |
| animate-type | String | Switch animation mode animate-type="ease" |
| animate-time | String | Switch animation time animate-time="1.0" seconds |
Step 3 (Insert Tag)
<slider></slider>//Insert html tag
<div ng-controller="firstCtrl"> <slider timer="2" data="data" btn-left="#btnleft" btn-right=".btnright" animate-type="ease" animate-time="1.0"> </slider> <div id="btnleft"></div> <div></div> </div>
var myModule = angular.module('myApp',[]); myModule.controller('firstCtrl', function($scope) { $scope.data = [{img: "../img/1.jpg",link:"#"}]; });Summarize
The above is the entire content of this article. I hope this article will be helpful to everyone. If you have any questions, you can leave a message to communicate.