<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>
$(document).ready(function(){
$(".up-btn").click(function(){
$("p").slideUp("slow", function(){
alert("The slide-up effect is completed.");
$(".down-btn").click(function(){
$("p").slideDown("slow", function(){
alert("The slide-down effect is completed.");
<button type="button" class="up-btn">Slide Up Paragraphs</button>
<button type="button" class="down-btn">Slide Down Paragraphs</button>
<p>This is a paragraph.</p>