私は同様の必要性のためにこのようなことをしました
window.mySwipe = new Swipe(document.getElementById('userSlider'), {
startSlide: 0,
speed: 400,
continuous: false,
disableScroll: false,
stopPropagation: false,
callback: function(index, elem) {
if(window.mySwipe.getPos() === 3){
setTimeout(function(){
$('#userSlider').fadeOut();
}, 500);
}
},
transitionEnd: function(index, elem) {}
});
これを行うこともでき、同じ結果が得られます
window.mySwipe = new Swipe(document.getElementById('userSlider'), {
startSlide: 0,
speed: 400,
continuous: false,
disableScroll: false,
stopPropagation: false,
callback: function(index, elem) {},
transitionEnd: function(index, elem) {
if(window.mySwipe.getPos() === 3){
setTimeout(function(){
$('#userSlider').fadeOut();
}, 500);
}
}
});