jQuery – wait for animation to end then do something

Posted on Jul 12, 2010

I have been using jQuery for quite some time now. Following a question on one of the many forums and discussions group I visit daily, I found that not many know that jQuery has a built in way to “listen” for an animation to end and then continue work. For instance, if I am using the slideDown effect, I can create a function that will only execute when the slide is finished.

Wish to know how?

Just like that…

[js]

$(‘div.menuOurHotel’).slideDown(“slow”, function()

{

$(“div.order_form”).hide();

});

[/js]

This is a very useful way to create a responsive intuitive user interface.

Good luck!