slideToggle()
effect method with a callback function  that will be executed after the hide effect is completed.<!DOCTYPE html>
<html>
<head>
<title>jQuery Callback Functions</title>
<script src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").slideToggle("slow", function(){
alert("The slide toggle effect has completed.");
});
});
});
</script>
<style type="text/css">
.btn{ padding:6px 15px;}
p{ background:#0099da; font-size: 24px;padding:20px; color:#FFF; text-align:center;}
</style>
</head>
<body>
<button type="button" class="btn">Click Here!</button>
<p>This is a sample paragraph.</p>
</body>
</html>
slideToggle()
effect is completed :
<!DOCTYPE html>
<html>
<head>
<title>jQuery Without Callback Functions</title>
<script src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
//$("p").slideToggle(1000);
$("p").slideToggle("slow");
alert("The slide toggle effect has completed.");
});
});
</script>
<style type="text/css">
.btn{ padding:6px 15px;}
p{ background:#0099da; font-size: 24px;padding:20px; color:#FFF; text-align:center;}
</style>
</head>
<body>
<button type="button" class="btn">Click Here!</button>
<p>This is a sample paragraph.</p>
</body>
</html>