Callback Functions in jQuery

After the current effect has completed wholly, a callback function is executed.


Callback Functions in jQuery

Line by line, JavaScript tasks are completed. Nevertheless, with impacts, the very next piece of code can be performed even if the impact is not yet finished. It might lead to mistakes.

You can avoid this by writing a callback function.

After the current effect has finished, a callback function is performed.

Syntax is as follows: $ (selector).hide(speed,callback);

Illustration

The callback parameter in the example below is a function that will be executed after the conceal impact is finished:

EXAMPLE ❯