Skip to content Skip to sidebar Skip to footer

Stop/start Animation Loop On Click? Jquery

I am making a slideshow that continuously loops through 5 images etc. I have it looping fine but the loop won't start and stop. I was using a pause = true/false variable and addin

Solution 1:

var interval;
function slideBoxTimeout(){
    var interval = setInterval(function(){
        slideBoxTransition();
    }, delay);
}

$(".play").click(function() {
    slideBoxTimeout();
});
$(".pause").click(function() {
    clearInterval(interval);
});

taken from : jQuery play/pause jQuery function


Post a Comment for "Stop/start Animation Loop On Click? Jquery"