-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (63 loc) · 1.46 KB
/
index.html
File metadata and controls
68 lines (63 loc) · 1.46 KB
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.js"></script>
<style type="text/css">
#first {
background-color: red;
width: 100px;
height: 100px;
position: relative;
top: 50px;
left: 40px;
}
#second {
background-color: blue;
width: 50px;
height: 50px;
position: relative;
top: 300px;
left: 420px;
}
#third {
background-color: green;
width: 200px;
height: 200px;
position: relative;
top: 100px;
left: 10px;
}
</style>
<script type="text/javascript">
$(function(){
$('#animate').click(function(){
$('#first').animate({
'width':'10px',
'left':'150px',
'top':'100px'
}, 5000, 'swing');
$('#second').animate({
'width':'200px',
'height':'200px',
'left':'200px',
'top':'100px'
}, 5000, 'swing');
$('#third').animate({
'width':'20px',
'height':'80px',
'left':'200px',
'top':'100px'
}, 5000, 'linear'); // Для друзих типов замедления: jquery plugin: easing
});
})
</script>
</head>
<body>
<button id="animate">animate</button>
<div id="first"></div>
<div id="second"></div>
<div id="third"></div>
</body>
</html>