Front end plug-in--swipe.js

Source: Internet
Author: User
Tags time in milliseconds

The role of Swipe.js:

This is a lightweight mobile sliding component that supports touch mobility and supports responsive pages.

Code:
1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title>Title</title>6<style>7*{8padding:0;9margin:0;Ten         } One . Swipe { A Overflow:hidden; - position:relative; - width:800px; the         } -. swipe-Wrap { - Overflow:hidden; - position:relative; +list-Style:none; -         } +. swipe-wrap >Li { A             float: Left; atwidth:100%; - position:relative; -         } -. swipe-wrap > Li >a{ -width:100%; - Display:block; in         } -. swipe-wrap > li > A >img{ towidth:100%; + Display:block; -         } the</style> *<script src= "./js/swipe.js" ></script> $Panax Notoginseng<body> -<!--swipe need a structure like this, not a label like the one below, which means that the label name can be arbitrary-- the<div id= ' slider ' class= ' swipe ' > +<ul class= ' Swipe-wrap ' > A<li> the<a href= "javascript:;" class= "wrap" > + -</a> $</li> $<li> -<a href= "javascript:;" class= "wrap" > - the</a> -</li>Wuyi<li> the<a href= "javascript:;" class= "wrap" > - Wu</a> -</li> About<li> $<a href= "javascript:;" class= "wrap" > - -</a> -</li> A<li> +<a href= "javascript:;" class= "wrap" > the -</a> $</li> the<li> the<a href= "javascript:;" class= "wrap" > the the</a> -</li> in<li> the<a href= "javascript:;" class= "wrap" > the About</a> the</li> the<li> the<a href= "javascript:;" class= "wrap" > + -</a> the</li>Bayi</ul> the</div> the<script> -     /* - swipe can extend optional parameters-by setting the object's key-value pairs: the startslide Integer (default: 0)-index of swipe start the speed Integer (default: 300)-the rate of advance and background, in milliseconds. the Auto Integer-Auto Slide (time in milliseconds between slides) the continuous Boolean (default: TRUE)-whether it can be looped (note: I am set to false as if it is also looping) - disablescroll Boolean (default: false)-stop touch swipe the stoppropagation Boolean (default: false)-stop event propagation the callback Functions-callback function, you can get the index of the picture in the slide. the Transitionend Function-functions that are executed after a sliding transition animation94     * */ theWindow.myswipe =NewSwipe (document.getElementById (' slider ')), { thestartslide:0, thespeed:400,98auto:3000, AboutContinuous:true, -Disablescroll:false,101Stoppropagation:false,102Callbackfunction(index, elem) {103 Console.log (index);104 Console.log (elem); the         },106Transitionend:function(index, elem) {}107     });108</script>109</body> the

Front end plug-in--swipe.js

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.