Use Angularjs to achieve the slide effect,

Source: Internet
Author: User

Use Angularjs to achieve the slide effect,

Preface

Since the development of Jquery, the magic lamp components have become very mature. So let's take a look at the steps to achieve the slide effect using Angularjs.

Npm Installation

npm install angularjsSlider

Usage

Step 1 (Introduction)

Require ('angularjsslider') (moduleName); // Import

Step 2 (parameter configuration)

Type Description
Data Array Slide picture data [{img: "1.jpg", link: '#'}...]
Timer Number Slide switching interval timer = "2"
Btn-left String Switch button on the left btn-left = "# btnleft"
Btn-right String Switch button btn-right = ". btnright" on the right"
Animate-type String Animation switching mode animation-type = "Animation"
Animate-time String Animation switching time: animation-time = "1.0" seconds

Step 3 (insert tag)

<Slider> </slider> // insert html tags
<div class="sliderBox" ng-controller="firstCtrl">    <slider timer="2" data="data" btn-left="#btnleft" btn-right=".btnright" animate-type="ease" animate-time="1.0">    </slider>    <div class="btn left" id="btnleft"></div>    <div class="btn right btnright"></div>  </div>
var myModule = angular.module('myApp',[]);  myModule.controller('firstCtrl', function($scope) {    $scope.data = [{img: "../img/1.jpg",link:"#"}];  });

Summary

The above is all the content of this article. I hope this article will help you. If you have any questions, please leave a message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.