Skip to content

Commit c24fb08

Browse files
committed
jQuery Effects - fadeIn() | fadeOut() 🚀
1 parent 2b6fda4 commit c24fb08

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

jQuery/jQuery-Effects/fading.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
$("#fadeIn").click(function () {
9+
$("#div1").fadeIn();
10+
$("#div2").fadeIn("slow");
11+
$("#div3").fadeIn(3000);
12+
});
13+
14+
$("#fadeOut").click(function () {
15+
$("#div1").fadeOut();
16+
$("#div2").fadeOut("slow");
17+
$("#div3").fadeOut(3000);
18+
});
19+
});
20+
</script>
21+
</head>
22+
23+
<body>
24+
25+
<p>Demonstrate fadeOut() | fadeIn() with different parameters. (Default fadeIn)</p>
26+
27+
<button id="fadeIn">Click to fade in boxes</button>
28+
<button id="fadeOut">Click to fade out boxes</button><br><br>
29+
30+
<div id="div1" style="width:80px;height:80px;background-color:red;"></div><br>
31+
<div id="div2" style="width:80px;height:80px;background-color:green;"></div><br>
32+
<div id="div3" style="width:80px;height:80px;background-color:blue;"></div>
33+
34+
</body>
35+
36+
</html>

0 commit comments

Comments
 (0)