Swipe
Swipe copied to clipboard
Why reset the delay to zero in the `stop` function
Hey guys, there is a question for the function stop.
here is the code
function stop() {
delay = 0;
clearTimeout(interval);
}
why reset the delay to zero ? What's it for ? Cause by this, when I config with
auto : 3000
it works well automatically , but when swipe event fired, it could not works correctly : could not slide automatically and swipe still works. Any ideas?
Here is a demo page : swipe-mobile-touch-slider
Sorry for my English and best wishes for you. ;-)
Hi @YoRolling I maintain a independent project of this one. And the issue you reported has been fixed in my own fork https://github.com/lyfeyaj/swipe, hope this can help you.
function stop(b) { if(b) delay = 0; clearTimeout(interval); }
do like this when you want to stop interval:
swipe = new swipe(obj, options); siwpe.stop(true);