-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path动画.html
84 lines (77 loc) · 2.07 KB
/
动画.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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>动画</title>
<style>
body{
margin: 0;
}
#div1{
width: 400px;
height: 400px;
background: #ff0000;
position: relative;
}
</style>
</head>
<body>
<button id="hide">hide</button>
<button id="show">show</button>
<button id="toggle">toggle</button>
<button id="animate">animate</button>
<button id="fadein">fadeIn</button>
<button id="fadeout">fadeOut</button>
<button id="fadetoggle">fadeToggle</button>
<button id="slideup">slideUp</button>
<button id="slidedown">slideDown</button>
<button id="slidetoggle">slideToggle</button>
<button id="animated">animated</button>
<div id="div1"></div>
<script src="jquery-1.12.4.js"></script>
<script>
$(function(){
var $div1 = $("#div1");
$("#hide").on("click", function(){
$div1.stop().hide(5000);
});
$("#show").on("click", function(){
$div1.stop().show(5000);
});
$("#toggle").on("click", function(){
$div1.toggle(2000);
});
$("#animate").on("click", function(){
$div1.animate({
left: 800
}, 2000, "easeInBounce", function(){
/*$div1.animate({
height: 600
}, 2000)*/
});
});
$("#fadein").on("click", function(){
$div1.fadeIn("slow");
});
$("#fadeout").on("click", function(){
$div1.fadeOut("slow");
});
$("#fadetoggle").on("click", function(){
$div1.fadeToggle();
});
$("#slideup").on("click", function(){
$div1.slideUp();
});
$("#slidedown").on("click", function(){
$div1.slideDown();
});
$("#slidetoggle").on("click", function(){
$div1.slideToggle();
});
$("#animated").on("click", function(){
$("#div1:animated").css("background", "#0f0");
});
});
</script>
</body>
</html>