forked from tobia/Pause
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.html
60 lines (60 loc) · 1.32 KB
/
demo.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
<!DOCTYPE html>
<html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<head>
<script type="text/javascript" charset="utf-8" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery.animation-controller.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
jQuery.fx.interval = 50;
$("#start").click(function() {
$(".block").animate({
"left" : "1000px"
}, 10000);
});
$("#pause").click(function() {
$(".block").pause();
});
$("#resume").click(function() {
$(".block").resume();
});
$("#ff").click(function() {
$("#block2").fastForward();
});
$("#rewind").click(function() {
$(".block").rewind();
});
})
</script>
<style>
div {
position: relative;
background-color: #abc;
left: 50px;
width: 90px;
height: 90px;
margin: 5px;
}
</style>
</head>
<body>
<button id="start">
开始动画 start
</button>
<button id="pause">
暂停 pause
</button>
<button id="resume">
恢复 resume
</button>
<button id="ff">
快进 ff
</button>
<button id="rewind">
倒退 rewind
</button>
<div class="block"></div>
<div class="block" id="block2"></div>
<div class="block"></div>
</body>
</html>