#11 jQuery Callback Function | jQuery Chaining

Publié le: 01 janvier 1970
sur la chaîne: Stack Developers
236
8

A callback function is executed after the current effect is finished.

We have seen the callback function in syntax of most of the jQuery methods we have done earlier like animate, slide, fade etc. but now we are going to actually use it practically.

Syntax :-
$(selector).hide(speed,callback);

Example :-
The example in video has a callback function that will be executed after the animate effect is completed.

Example without Callback :-
The example in video has no callback function, and the alert box will be displayed before the animate effect is completed.

jQuery Chaining :-
jQuery Chaining means Chain together or group together multiple jQuery methods within a single statement.

This way, browsers do not have to find the same element(s) more than once.

Example :-
$(document).ready(function(){
$("button").click(function(){
$("h1").animate({left: '250px'}).css("color", "green");
});
});

Join this channel to get access to perks:
   / @stackdevelopers  


Sur cette page du site, vous pouvez voir la vidéo en ligne #11 jQuery Callback Function | jQuery Chaining durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Stack Developers 01 janvier 1970, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 236 fois et il a aimé 8 téléspectateurs. Bon visionnage!