Grow your CSS skills. Land your dream job.

Last updated on:

Perform Function At Timed Intervals

Perform a function every one second:

function myFunction() {
   // do something
}

var int = setInterval(myFunction, 1000);

Cancel it:

clearInterval(int);

Pass variables when calling custom function:

setInterval(function(){ doMove(panelWidth, tooFar); }, delayLength);

Leave a Comment

Current day month ye@r *

*May or may not contain any actual "CSS" or "Tricks".