jQuery – wait for animation to end then do something

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…

		$('div.menuOurHotel').slideDown("slow", function()
		{
			$("div.order_form").hide();
		});

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

Good luck!

  • Denis

    Nothing to deal with Listeners, it’s a simple callback function.