I have an image with a jquery click attached to it
<img src=pic.gif id="action">
and some jquery
$("#action").click(function(){
alert("DONE");
});
How could I edit this so that the action function can’t run for x seconds after it has ran? Say if I wanted it disabled for 5 seconds after each click.
You can store the function in a variable. In that unbind the event and again attach it. This makes sure it will run only after the time period elapses..
Try this
Check this DEMO