3 <title>Transition End Events
</title>
4 <style type=
"text/css" media=
"screen">
11 background-color: blue;
12 -webkit-transform: translate(
0);
13 -webkit-transition-property: -webkit-transform;
14 -webkit-transition-duration:
0.5s;
18 -webkit-transform: translate(
50px);
22 -webkit-transform: translate(
50px) scale(
1.05);
23 -webkit-transition-duration:
0.55s;
27 -webkit-transform: translate(
0); /* same as default */
28 -webkit-transition-duration:
0.3s;
32 -webkit-transform: translate(
100px);
33 -webkit-transition-duration:
0.4s;
41 <script src=
"transition-end-event-helpers.js" type=
"text/javascript" charset=
"utf-8"></script>
42 <script type=
"text/javascript" charset=
"utf-8">
44 var expectedEndEvents = [
45 // [property-name, element-id, elapsed-time, listen]
46 [
"-webkit-transform",
"box1",
0.5, false],
47 [
"-webkit-transform",
"box2",
0.55, false],
48 [
"-webkit-transform",
"box4",
0.4, false]
51 function transitionElement(index)
53 var boxes = document.body.getElementsByClassName('box');
54 boxes[index-
1].className =
"box box" + index;
59 var boxes = document.body.getElementsByClassName('box');
60 for (var i =
0; i < boxes.length; ++i) {
61 boxes[i].addEventListener(
"webkitTransitionEnd", recordTransitionEndEvent, false);
64 window.setTimeout(function() { transitionElement(
1); },
100);
65 window.setTimeout(function() { transitionElement(
2); },
150);
66 window.setTimeout(function() { transitionElement(
3); },
200);
67 window.setTimeout(function() { transitionElement(
4); },
50);
68 window.setTimeout(function() { transitionElement(
5); },
150);
71 runTransitionTest(expectedEndEvents,
1.0, setupTest);
77 <p>Initiating transitions on transform properties of all boxes, starting at different times and with different durations and values.
</p>
80 <div id=
"box1" class=
"box"></div>
81 <div id=
"box2" class=
"box"></div>
82 <div id=
"box3" class=
"box"></div>
83 <div id=
"box4" class=
"box"></div>
84 <div id=
"box5" class=
"box"></div>
87 <div id=
"result"></div>