标签:des style blog http io ar color os 使用
官网:http://www.swipejs.com
github:https://github.com/bradbirdsall/Swipe
swipe.js是一个比较有名的触摸滑动插件,它能够处理内容滑动,支持自定义选项,你可以让它自动滚动,控制滚动间隔,返回回调函数等。经常可见使用在移动开发中
HTML代码如下:
<div id=‘slider‘ class=‘swipe‘> <div class=‘swipe-wrap‘> <div></div> <div></div> <div></div> </div> </div>
CSS代码如下:
.swipe { overflow: hidden; visibility: hidden; position: relative; } .swipe-wrap { overflow: hidden; position: relative; } .swipe-wrap > div { float:left; width:100%; position: relative; }
JS代码:
window.mySwipe = Swipe(document.getElementById(‘slider‘));
window.mySwipe = new Swipe(document.getElementById(‘slider‘), { startSlide: 2, speed: 400, auto: 3000, continuous: true, disableScroll: false, stopPropagation: false, callback: function(index, elem) {}, transitionEnd: function(index, elem) {} });
还有一些比较使用的API方法,例如:
相关上下滑动插件:
iscroll.js
标签:des style blog http io ar color os 使用
原文地址:http://www.cnblogs.com/zion0707/p/4109484.html