Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Stop Firing Event Until an Effect is Completed</title> <style> .box{ height: 300px; display: none; background: yellowgreen; } </style> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $(".box").slideDown(3000, function(){ $(".hint").text("Sliding is completed, now fading out."); $(this).fadeOut(3000, function(){ $(".hint").text("Fading out completed."); }); }); }); </script> </head> <body> <div class="box"></div> <p class="hint"></p> </body> </html>