-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
39 lines (36 loc) · 1011 Bytes
/
index.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
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Fade Animations with jQuery</title>
<style>
#box {
background-color: #ff6347; /* A light red color */
padding: 50px;
text-align: center;
width: 300px;
height: 100px;
display: none; /* Initially hidden */
}
</style>
</head>
<body>
<button id="fadeInBtn">Fade In</button>
<button id="fadeOutBtn">Fade Out</button>
<div id="box">Fading Content!</div>
<!-- Include jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
// Fade In content
$("#fadeInBtn").click(function () {
$("#box").fadeIn("slow");
});
// Fade Out content
$("#fadeOutBtn").click(function () {
$("#box").fadeOut("slow");
});
});
</script>
</body>
</html>