1.插件要求的css样式:

<style>
.swipe {
overflow: hidden;
visibility: hidden;
position: relative;
}
.swipe-wrap {
overflow: hidden;
position: relative;
}
.swipe-wrap > li {
float:left;
width:100%;
position: relative;
}

</style>

2.JS代码:

<script>
var el = document.querySelector(\’.view\’);
var mySwipe = Swipe(el, {
startSlide: 6,
auto: 2000,
callback: function(key, el) {

},
transitionEnd: function(index, elem) {
console.log(index, elem);
}
});
</script>

版权声明:本文为peachGirl原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/peachGirl/p/5978995.html