forked from burg/timelapse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transition-end-event-multiple-01.html
50 lines (43 loc) · 1.24 KB
/
transition-end-event-multiple-01.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
<html>
<head>
<style>
.box {
position: relative;
left: 0;
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
-webkit-transition-property: width, left, background-color, height, top;
-webkit-transition-duration: 0.5s;
}
</style>
<script src="transition-end-event-helpers.js"></script>
<script type="text/javascript">
var expectedEndEvents = [
// [property-name, element-id, elapsed-time, listen]
["background-color", "box1", 0.5, false],
["height", "box1", 0.5, false],
["left", "box1", 0.5, false],
["width", "box1", 0.5, false],
];
function setupTest()
{
var box = document.getElementById("box1");
box.addEventListener("webkitTransitionEnd", recordTransitionEndEvent, false);
box.style.width = "150px";
box.style.left = '200px';
box.style.backgroundColor = 'red';
box.style.height = '80px';
}
runTransitionTest(expectedEndEvents, setupTest);
</script>
</head>
<body>
<p>Initiating a 500ms transition on the left, background-color, width and height properties of box1.</p>
<div id="container">
<div id="box1" class="box"></div>
</div>
<div id="result"></div>
</body>
</html>