"Show and Hide"
Bootstrap 3.3.0 Snippet by couchcrumb

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/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 ----------> <div class="container"> <div class="row"> <h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2> <div id="div1" style="width:80px;height:80px;background-color:red;"> </div><br> <div id="div2" style="width:80px;height:80px;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;background-color:blue;"></div> <h2>Make me first on the list!</h2> <p>Good</p> <p>Bye</p> <p>for now.</p> <button id="hide" type="button" class="btn btn-info">Hide</button> <button id="show" type="button" class="btn btn-danger">Show</button> </div> </div>
h2 { color:red; }
$(document).ready(function(){ $("#hide").click(function(){ $("p").fadeOut(); $("#div1").fadeOut(); $("#div2").fadeOut("slow"); $("#div3").fadeOut(3000); }); }); $("#show").click(function(){ $("p").show(); $("#div1").show(); $("#div2").show("slow"); $("#div3").show(3000); }); });

Related: See More


Questions / Comments: