Is there any equivalent for setTimeout and clearTimeout functions in jquery 1.4.2…. I found this ex which uses jquery 1.3.2..
var alerttimer = window.setTimeout(function () {
$alert.trigger('click');
}, 3000);
$alert.animate({height: $alert.css('line-height') || '50px'}, 200)
.click(function () {
window.clearTimeout(alerttimer);
$alert.animate({height: '0'}, 200);
});
that would make use of jQuerys fx queuing to create a timeout. To emulate an interval in that manner, use a function which calls itself in the callback closure.
Use
$(document.body).stop()to clear the fx queue and stop the interval.That works similiar to a javascript
setTimeoutinterval “hack”.