harshpandya Posted March 10, 2008 Share Posted March 10, 2008 like right now i have function - if you click on iframe it does something()What i want is i want to put timer that if they click once they have to wait for 3 second and then and then they can click again and function runs again.so any function timer - do we have?Any other way ?Help Link to comment Share on other sites More sharing options...
jeffman Posted March 10, 2008 Share Posted March 10, 2008 setTimeout() or setInterval(). In this case, probably setTimeout(). be sure to assign it to a variable so you can cancel it if you want. Link to comment Share on other sites More sharing options...
jesh Posted March 10, 2008 Share Posted March 10, 2008 Something like so: var canDoSomething = true;function doSomething(){ if(canDoSomething) { // Do the something here... canDoSomething = false; setTimeout("canDoSomething = true;", 5000); }} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.