I want widget.Rotator.rotate()
to be delayed 5 seconds between calls... how do I do this in jQuery... it seems like jQuery's delay()
wouldn't work for this...
This question is related to
javascript
jquery
var rotator = function(){
widget.Rotator.rotate();
setTimeout(rotator,5000);
};
rotator();
Or:
setInterval(
function(){ widget.Rotator.rotate() },
5000
);
Or:
setInterval(
widget.Rotator.rotate.bind(widget.Rotator),
5000
);
Source: Stackoverflow.com