Tuesday, July 24, 2012

javascript – delaying a statment in jquery?



i have two lines of javascript here, when the toggle function executes i want to delay before the find function happens.



$activeToggle.toggle(\"fast\"); // i want this to run and then after 1250 millisec
$activeToggle.find(\".anime\").each(function (i,e){ // this code runs

alert(e.id);

});


I want to delay the second line of code to execute, because for some reason the alert is happening before the toggle action takes place, so their must a be way to delay the second line. thanks






Rating: 5 out of 5 based on 6 ratings



The post javascript – delaying a statment in jquery? appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/javascript-delaying-a-statment-in-jquery.html

No comments:

Post a Comment