Not sure if it is the best way to do it, but here's what I am trying:
Example Code:
$("#someElement").mouseout(function() {
var firstLoop = setTimeout(function() {
//do something
}, 2000);
setTimeout(function() {
//do something else
}, 4000);
var timer = 1000;
setTimeout(firstLoop, timer); //this doesn't works
});
I am trying to loop this infinitely.
timeout?setIntervalinstead ?setIntervalalso. Didn't work.