70 lines
1.5 KiB
HTML
70 lines
1.5 KiB
HTML
<html>
|
|
<head>
|
|
<style>
|
|
.box {
|
|
position: relative;
|
|
left: 0;
|
|
height: 100px;
|
|
width: 100px;
|
|
margin: 10px;
|
|
background-color: blue;
|
|
-webkit-transition-duration: 0.5s;
|
|
}
|
|
|
|
.box1 {
|
|
left: 50px;
|
|
}
|
|
|
|
.box2 {
|
|
background-color: red;
|
|
left: 50px;
|
|
}
|
|
|
|
.box3 {
|
|
width: 150px;
|
|
background-color: green;
|
|
left: 50px;
|
|
height: 120px;
|
|
-webkit-transition-duration: 0.7s;
|
|
}
|
|
|
|
</style>
|
|
<script src="transition-end-event-helpers.js"></script>
|
|
<script type="text/javascript">
|
|
|
|
var expectedEndEvents = [
|
|
// [property-name, element-id, elapsed-time, listen]
|
|
["background-color", "box2", 0.5, true],
|
|
["background-color", "box3", 0.7, true],
|
|
["height", "box3", 0.7, true],
|
|
["left", "box1", 0.5, true],
|
|
["left", "box2", 0.5, true],
|
|
["left", "box3", 0.7, true],
|
|
["width", "box3", 0.7, true]
|
|
];
|
|
|
|
function setupTest()
|
|
{
|
|
var boxes = document.body.getElementsByClassName('box');
|
|
for (var i = 0; i < boxes.length; ++i) {
|
|
boxes[i].className = "box box" + (i+1);
|
|
}
|
|
}
|
|
|
|
runTransitionTest(expectedEndEvents, setupTest);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<p>Initiating transitions on various properties of all boxes.</p>
|
|
|
|
<div id="container">
|
|
<div id="box1" class="box"></div>
|
|
<div id="box2" class="box"></div>
|
|
<div id="box3" class="box"></div>
|
|
</div>
|
|
|
|
<div id="result"></div>
|
|
|
|
</body>
|
|
</html> |