"hide and show div animation"
Bootstrap 4.1.1 Snippet by durgesh361

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html lang="en"> <head> <title>Hide Show Div</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Example</h2> <div class="panel"> <div class="panel-heading" id="slideup">Click Me To Slide Down</div> <div class="panel-body" id="body" style="display:none">Hello Friends!</div> <div class="panel-heading" id="bodyup" style="display:none">Click Me To Slide Up</div> </div> </div> </body> </html>
.panel-body{ height:100px; color:#fff; background:gray; } .panel-heading{ font-weight:bold; background:red; color:#fff; }
$(document).ready(function(){ $('#slideup').click(function(){ $('#body').slideDown(); $('#bodyup').show(); }); $('#bodyup').click(function(){ $('#body').slideUp(); $('#bodyup').hide(); }); });

Related: See More


Questions / Comments: