Using Angularjs to realize slide effect _ANGULARJS

Source: Internet
Author: User

Objective

Since the development of jquery, the slideshow has been very mature, so here are a few steps to take a look at using ANGULARJS to achieve the slide effect.

NPM mode installation

NPM Install Angularjsslider

How to use

First Step (introduction)

Require (' Angularjsslider ') (modulename);

Step Two (parameter configuration)

Type Description
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 Right toggle button btn-right= ". Btnright"
Animate-type String Toggle Animation mode animate-type= "Ease"
Animate-time String Toggle Animation Time Animate-time= "1.0" seconds

Step three (insert label)

<slider></slider>//Insert HTML tag
<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:" # "}];
  

Summarize

The above is the entire content of this article, I hope this article for everyone can help, if there are questions you can message exchange.

Related Article

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.