top of page

JavaScript statements are executed line by line. However, with effects, the next line of code can be run even though the effect is not finished. This can create errors.

 

To prevent this, you can create a callback function.
A callback function is executed after the current effect is finished.

 

 syntax: $(selector).hide(speed,callback);

The example below has a callback parameter that is a function that will be executed after the hide effect is completed:


 


$("button").click(function(){

$("p").hide("slow",function(){

alert("The paragraph is now hidden");

});

});

Jquery CallBack Function

Add Effects To Your WebPage

© 2023 BY CODE MODE

  • Facebook Basic Black
  • Twitter Basic Black
  • Instagram Basic Black

codemode2016@gmail.com   |   Chitkara University,HIMUDA Education Hub,Atal                                             |       Nagar,Barotiwala, Distt.-Solan, HP 174-103

bottom of page