<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of jQuery Slide-Up and Slide-Down Effects with Callback</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <style> p{ padding: 20px; background: yellow; } </style> <script> $(document).ready(function(){ // Display alert message after sliding up paragraphs $(".up").click(function(){ $("p").slideUp("slow", function(){ // Code to be executed alert("The slide-up effect is completed."); }); }); // Display alert message after sliding down paragraphs $(".down").click(function(){ $("p").slideDown("slow", function(){ // Code to be executed alert("The slide-down effect is completed."); }); }); }); </script> </head> <body> <button type="button" class="up">Slide Up</button> <button type="button" class="down">Slide Down</button> <p>Happy Morning..</p> </body> </html>