3 <title>Transition End Events
</title>
4 <style type=
"text/css" media=
"screen">
11 background-color: blue;
12 -webkit-transition-property: width, left, background-color, height, top;
13 -webkit-transition-duration:
0.2s;
21 background-color: red;
26 -webkit-transition-duration:
0.3s;
30 <script src=
"transition-end-event-helpers.js" type=
"text/javascript" charset=
"utf-8"></script>
31 <script type=
"text/javascript" charset=
"utf-8">
33 var expectedEndEvents = [
34 // [property-name, element-id, elapsed-time, listen]
35 [
"background-color",
"box2",
0.2, false],
36 [
"left",
"box1",
0.2, false],
37 [
"width",
"box3",
0.3, false],
40 function handleEndEvent2(event)
42 recordTransitionEndEvent(event);
45 function startTransition2()
47 var box = document.getElementById(
"box3");
48 box.addEventListener(
"webkitTransitionEnd", handleEndEvent2, false);
49 box.className =
"box box3";
52 function handleEndEvent1(event)
54 recordTransitionEndEvent(event);
56 setTimeout(startTransition2,
100);
59 function startTransition1()
61 var box = document.getElementById(
"box2");
62 box.addEventListener(
"webkitTransitionEnd", handleEndEvent1, false);
63 box.className =
"box box2";
66 function handleEndEvent(event)
68 recordTransitionEndEvent(event);
70 setTimeout(startTransition1,
100);
75 var box = document.getElementById(
"box1");
76 box.addEventListener(
"webkitTransitionEnd", handleEndEvent, false);
77 box.className =
"box box1";
80 runTransitionTest(expectedEndEvents,
2.0, setupTest);
86 <p>Initiating transitions on various properties of all boxes.
</p>
89 <div id=
"box1" class=
"box"></div>
90 <div id=
"box2" class=
"box"></div>
91 <div id=
"box3" class=
"box"></div>
94 <div id=
"result"></div>