How to stop firing event until an effect is finished in jQuery
Answer: Use the jQuery callback function
You can utilize the jQuery callback function mechanism to stop events from firing until an effect is completely finished, such as doing something after slide animation or fade out transition is fully completed and so on. Check out the following example.
ExampleTry this code »
<title>jQuery Fire Events after an Effect is Over</title>
$(".hint").text("Sliding is completed, now fading out.");
$(".hint").text("Fading out completed.");
Here are some more FAQ related to this topic: