"Learn jQuery"
Bootstrap 3.3.0 Snippet by NotGarrettOkay

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<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>Learn jQuery</h2>
<br>
<br>
<p>If you click on the "Hide" button, I will disappear.</p>
<br>
<button id="hide" type="button" class="btn btn-primary">Hide</button>
<div style="background:#98bf21;height:100px;width:100px;position:absolute;"></div>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
h2{
color:red;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
$(document).ready(function(){
$("#hide").click(function(){
$("p").toggle();
$(this).text(function(i, text){
$("div").animate({left: '250px'});
return text === "Hide" ? "Show" : "Hide";
});
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: