Skip to content Skip to sidebar Skip to footer

Pausing A Function "onclick"

I'm currently working on an image slideshow with 5 buttons (Start, stop, pause, backwards, forwards) My start button loads an autoRun function which starts to play through the imag

Solution 1:

Set your interval in a variable:

var interval = setInterval("changeImage(1)", 2000);

And clear it with clearInterval():

function pause(){
  clearInterval(interval);
}

Post a Comment for "Pausing A Function "onclick""