Slip.js (moving side follows finger slide assembly, 0 dependent)

Source: Internet
Author: User

Slip.js can be used for moving the sliding banner, mobile end of the whole screen slide and other effects, the personal feel for the mobile side of the sliding banner better, will not conflict with iscroll.js, because it does not rely on any other JS library.

Html:

<!doctype html> ...<ScriptType="Text/javascript"Src="Slip.js" ></Script><Body> ...<DivId="Container" ><Divclass="Page page-1" ><ImgSrc="Img/1.png" ></Div><Divclass="Page Page-2" ><img src= "img/2.png" ></< Span class= "title" >div> <div class= "page page-3" ><img src= "img/3.png" ></div> << Span class= "title" >div class= "page page-4" ><< Span class= "title" >img src= "img/4.png" ></< Span class= "title" >div> </div> </ BODY>

Js:

var container = document.getElementById(‘container‘);

var pages = document.querySelectorAll(‘.page‘);

var slip = Slip(container, ‘y‘).webapp(pages);

Explanation:

    • Slip: Exposure to the global approach, as long as you introduce slip.js , you can get this practical method.

    • container: The container being slid, inside is each sliding page.

    • ‘y‘: page swipe direction, you can also pass in ‘x‘ .

    • webapp: Sets the way the page is displayed as a full screen slide.

    • pages: A list of page elements.

Slip.js has a lot of powerful features, here is just a brief, detailed information see http://binnng.github.io/slip.js/docs/, source in http://binnng.github.io/slip.js/docs/slip.html.



Slip.js (moving side follows finger slide assembly, 0 dependent)

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.