The Callback function executes after the current animation 100% is complete.
Problems with JQuery animations
Many jQuery functions involve animations. These functions may use speed or duration as an optional parameter.
Example:$ ("P"). Hide ("slow")
the speed or duration parameter can set many different values, such as "slow", "fast", "normal", or milliseconds.
Instance
The following instances are callback functions after the hidden effect is fully implemented:
Use callback instance $ ("button"). Click (function () {
$ ("P"). Hide ("Slow", function () {
Alert ("The paragraph is now hidden");
});
});
Try
The following instance does not have a callback function, and the warning box pops up before the hidden effect is complete:
There is no callback (callback) $ ("button"). Click (function () {
$ ("P"). Hide (1000);
Alert ("The paragraph is now hidden");
});
Online examples»
JQuery Callback method