May 07, 2021 jQuery
The Callback function is executed after the current animation is 100% complete.
Many jQuery functions involve animation. These functions may use speed or duration as optional arguments.
Example: $("p").hide ("slow").
The speed or duration parameter can set many different values, such as "slow," "fast," "normal," or milliseconds.
Tip: Because JavaScript statements (instructions) are executed one by one - in order, statements after the animation may produce errors or page conflicts because the animation is not finished yet.
To avoid this, you can add the Callback function as an argument.
Instance
The following examples callback functions after the hidden effect is fully implemented:
The following instances do not have callback functions, and the warning box pops up before the hidden effect is complete: