-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (45 loc) · 1.26 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Animation Test</title>
<style>
@keyframes x{
100%{width: 500px}
}
@keyframes y {
100%{height: 200px}
}
.b{
width: 100px;
height: 100px;
background-color: lightblue;
margin: 20px;
}
</style>
</head>
<body>
<input type="submit" id="btn" value="fadeTo">
<input type="submit" id="btn2" value="transform">
<div id="a" class="b"></div>
<div id="c" class="b"></div>
<script src="animation.js"></script>
<script>
let btn = document.getElementById('btn'),
div = $(document.getElementById('a')),
btn2 = document.getElementById('btn2'),
div2 = $(document.getElementById('c'))
btn.onclick = function() {
div2.fadeTo(0.2)
}
btn2.onclick = function() {
div.animate('width: 200px')
.animate('height: 200px')
.animate('width: 100px')
.animate('height: 100px')
}
</script>
</body>
</html>