-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslide.html
30 lines (29 loc) · 1.21 KB
/
slide.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<head>
<title>jquery example</title>
<!-- This line will load the bootstrap css file -->
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<!-- This file will load jquery file so that we can use its function -->
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
</head>
<body>
<div class="panel panel-primary">
<h3 class="text-primary" align="center"> jquery example : slideDown() method</h3>
</div>
<div id="div1" class="panel panel-primary" style="background-color:yellow;">
<p align="center" class="text text-primary">Click on this panel to slide down another panel below this. This is the div with id="div1"</p>
</div>
<div id="div2" align="center" style="background-color:yellow;display:none;" class="panel panel-primary">
<p align="center" style="background-color:yellow;" class="text text-primary">This is the under the div with id="div2"</p>
</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
$("#div1").click(function(){
/*On the click of div with id="div1" the dive with id="div2" will slide down slowly
syntax : $(selector).slideDown(speed,callback);*/
$("#div2").slideDown("slow");
});
});
</script>
</html>