JQUERY callback

Click Here

The parameter callback to define that function executes when an effect has completely finished.

When we run two consecutive effects, you may run the second effect when the previous one has not yet ended.

For example, the alert effect that displays the paragraph "p" is hidden, could be displayed before it is really hidden, because the effect of hiding is performed slowly "slow".

$("p").hide("slow"); alert("It is now hidden");

To avoid this, and be sure that when it displays the message "alert" <p> element of concealment is complete, the second effect included in the parameter "callback"

$("p").hide("slow", function(){ alert("It is now hidden"); });

Click Here