-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheffect.html
93 lines (83 loc) · 2.64 KB
/
effect.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>effect</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.7.1.min.js"></script>
<style>
body {text-align: center;}
h3 {display: block; width: 200px; border: 1px solid; margin: 20px auto; }
.objtxt {background-color: aqua; display: none;}
</style>
<script>
$(function(){
// Show
$("button:eq(0)").click(function(){
$(".targets *").show(200);
})
$("button:eq(1)").click(function(){
$(".targets *").hide("slow", function(){
// alert("hide");
});
})
$("button:eq(2)").click(function(){
$(".targets *").toggle();
})
// Slide
$("button:eq(3)").click(function(){
$(".targets *").slideDown(2000);
})
$("button:eq(4)").click(function(){
$(".targets *").slideUp("slow", function(){
// alert("hide");
});
})
$("button:eq(5)").click(function(){
$(".targets *").slideToggle();
})
// Fade
$("button:eq(6)").click(function(){
$(".targets *").fadeIn(2000);
})
$("button:eq(7)").click(function(){
$(".targets *").fadeOut("slow", function(){
// alert("hide");
});
})
$("button:eq(8)").click(function(){
$(".targets *").fadeToggle();
})
$("button:eq(9)").click(function(){
$(".targets *").fadeTo(500, parseInt(Math.random() * 11) / 10);
})
});
</script>
</head>
<body>
<div class="btn-wrap">
<h3>toggle</h3>
<button>show</button>
<button>hide</button>
<button>toggle</button>
<h3>slide</h3>
<button>slideDown</button>
<button>slideUp</button>
<button>slideToggle</button>
<h3>fade</h3>
<button>fadeIn</button>
<button>fadeOut</button>
<button>fadeToggle</button>
<button>fadeTo</button>
</div>
<hr>
<div class="targets">
<h3 class="objtxt">Object Text</h3>
<h3 class="objtxt">Object Text</h3>
<h3 class="objtxt">Object Text</h3>
<h3 class="objtxt">Object Text</h3>
<h3 class="objtxt">Object Text</h3>
</div>
</body>
</html>