Swipe icon indicating copy to clipboard operation
Swipe copied to clipboard

Why reset the delay to zero in the `stop` function

Open YoRolling opened this issue 11 years ago • 2 comments

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. ;-)

YoRolling avatar Oct 11 '14 08:10 YoRolling

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.

lyfeyaj avatar Mar 02 '15 03:03 lyfeyaj

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);

khansuKOR avatar Mar 02 '15 16:03 khansuKOR