Javascript examples for jQuery Method and Property:fadeOut
Call function after fadeOut effect
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(".btn1").click(function(){ $("p").fadeOut(1000, function(){ console.log("fadeOut() method is finished!"); });/* ww w . j av a2s .c o m*/ }); $(".btn2").click(function(){ $("p").fadeIn(1000, function(){ console.log("fadeIn() method is finished!"); }); }); }); </script> </head> <body> <p>This is a paragraph.</p> <button class="btn1">Fade out</button> <button class="btn2">Fade in</button> </body> </html>