Skip to content

Commit 8432d50

Browse files
committed
jQuery stop() Method
1 parent 75c2749 commit 8432d50

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

jQuery/jQuery-Effects/stop.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
6+
<script>
7+
$(document).ready(function () {
8+
$("#flip").click(function () {
9+
$("#panel").slideDown(5000);
10+
});
11+
$("#stop").click(function () {
12+
$("#panel").stop();
13+
});
14+
});
15+
</script>
16+
<style>
17+
#panel,
18+
#flip {
19+
padding: 5px;
20+
font-size: 18px;
21+
text-align: center;
22+
background-color: rgb(82, 75, 75);
23+
color: white;
24+
border: solid 1px rgb(170, 142, 142);
25+
border-radius: 3px;
26+
}
27+
28+
#panel {
29+
padding: 50px;
30+
display: none;
31+
}
32+
</style>
33+
</head>
34+
35+
<body>
36+
37+
<button id="stop">Stop sliding</button>
38+
39+
<div id="flip">Click to slide down panel</div>
40+
<div id="panel">Hello world!</div>
41+
42+
</body>
43+
44+
</html>

0 commit comments

Comments
 (0)