-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
54 lines (40 loc) · 1.12 KB
/
example.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.box-1 {
width: 100px;
height: 100px;
background-color: lightblue;
opacity: 0;
}
.box-2 {
width: 100px;
height: 100px;
background-color: lightgreen;
position: absolute;
top: 20px;
right: 40px;
}
</style>
</head>
<body>
<div class="box-1"></div>
<div class="box-2"></div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
<script src="timeline-scrubber.js"></script>
<script>
var myTimeline = new TimelineLite({paused:true});
myTimeline.fromTo ('.box-1', 1.5, {opacity:0, scale:2, rotation:-720, x:'+30', y:'-20'}, {opacity:1, scale:1, rotation:0, x:0, y:0});
TimelineScrubber.init(myTimeline);
var otherTimeline = new TimelineLite({paused:true});
otherTimeline.fromTo ('.box-2', 0.5, {rotation: 0, y:20}, {rotation: 90, y:200});
TimelineScrubber.init(otherTimeline, 'animation 2');
</script>
</body>
</html>