Swipe
Swipe copied to clipboard
a bug
Hi,
i find a bug when continuous is true and the contains of swipe only two :
<div id="swipeBanner" class="swipe">
<div class="swipe-wrap">
<div>
<a href="#" class="js-link">
<img src="http://p8.qhimg.com/t011d09db6e0a82b2d4.jpg">
</a>
</div>
<div>
<a href="#" class="js-link">
<img src="http://p1.qhimg.com/t010690128aa27118ba.jpg">
</a>
</div>
</div>
</div>
var ele = $('#swipeBanner').get(0)
var swipe = Swipe(ele,{
continuous : true ,
disableScroll : true ,
transitionEnd : function(index,ele){
console.log(swipe.getPos())
}
})
then,the contain has four swipes actually :

I could be wrong, but are the div's at index 0 and 3 not the cloned div's?
This is by design I'd imagine since when reaching the last slide, you'd want to go back to the first slide. To do this, they're cloning the first and appending it to then end. Likewise with the last div - they're cloning it and pre-pending it before the first div.
@riskers , Hi you can try https://github.com/lyfeyaj/swipe, an active developing fork of this project which have this issue fixed.