Use of swipe. js, use of swipe. js

Source: Internet
Author: User

Use of swipe. js, use of swipe. js
Introduction

Github: https://github.com/thebird/swipe

A js component for image scrolling. It supports gesture touch screen.

Usage
<div id='slider' class='swipe'>  <div class='swipe-wrap'>    <div></div>    <div></div>    <div></div>  </div></div>
.swipe {  overflow: hidden;  visibility: hidden;  position: relative;}.swipe-wrap {  overflow: hidden;  position: relative;}.swipe-wrap > div {  float:left;  width:100%;  position: relative;}

This is a nested container,

Write js Code:

window.mySwipe = Swipe(document.getElementById('slider'));
Attribute Introduction
  • StartSlide Integer (default: 0)-start div
  • Speed Integer (default: 300)-Sliding speed
  • Auto Integer-automatically scroll after several milliseconds (two scrolling intervals)
  • Continuous Boolean (default: true)-Infinite Loop
  • DisableScroll Boolean (default: false)-Disable gesture sliding
  • StopPropagation Boolean (default: false)-stop event propagation does not understand its role for the moment
  • Callback Function-callback event during switchover
  • TransitionEnd Function-slide to the last page to execute the event
Method Introduction
  • Prev () backward
  • Next () Forward
  • Current location of getPos ()
  • Total number of getNumSlides () screens
  • Slide (index, duration) slides to a screen

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.