-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jquery_6.html
56 lines (44 loc) · 1.59 KB
/
Jquery_6.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Jquery 4</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
/*
$("button").click(function(){
$("#div1").fadeIn();
$("#div2").fadeIn("slow");
$("#div3").fadeIn(3000);
});
*/
/*
$("button").click(function(){
$("#div1").fadeOut();
$("#div2").fadeOut("slow");
$("#div3").fadeOut(3000);
});
*/
$("button").click(function(){
$("#div1").fadeTo("slow",0.14);
$("#div2").fadeTo("slow",0.5);
$("#div3").fadeTo("fast",0.7);
});
});
</script>
</head>
<body>
<p> Click vào button dưới đây để thấy hiệu ứng</p><br>
<button id="show">Click me</button><br><br>
<!-- fadeIn();
<div id="div1" style="width: 80px; height: 80px; background-color: red; display:none;"></div><br><br>
<div id="div2" style="width: 80px; height: 80px; background-color: blue; display:none;"></div><br><br>
<div id="div3" style="width: 80px; height: 80px; background-color: green; display:none;"></div><br><br> -->
<!-- fadeOut() + fadeTo() -->
<div id="div1" style="width: 80px; height: 80px; background-color: red;"></div><br><br>
<div id="div2" style="width: 80px; height: 80px; background-color: blue;"></div><br><br>
<div id="div3" style="width: 80px; height: 80px; background-color: green;"></div><br><br>
</body>
</html>