OLD | NEW |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
2 "http://www.w3.org/TR/html4/loose.dtd"> | 2 "http://www.w3.org/TR/html4/loose.dtd"> |
3 | 3 |
4 <html lang="en"> | 4 <html lang="en"> |
5 <head> | 5 <head> |
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
7 <title>Transitions and paused animations</title> | 7 <title>Transitions and paused animations</title> |
8 <style type="text/css" media="screen"> | 8 <style type="text/css" media="screen"> |
9 | 9 |
10 .container { | 10 .container { |
11 height: 200px; | 11 height: 200px; |
12 width: 200px; | 12 width: 200px; |
13 border: 1px solid black; | 13 border: 1px solid black; |
14 -webkit-transition: -webkit-transform 0.5s; | 14 -webkit-transition: -webkit-transform 0.5s; |
15 } | 15 } |
16 | 16 |
17 .moved { | 17 .moved { |
18 -webkit-transform: translateX(100px); | 18 transform: translateX(100px); |
19 | 19 |
20 } | 20 } |
21 .box { | 21 .box { |
22 position: relative; | 22 position: relative; |
23 height: 100px; | 23 height: 100px; |
24 width: 100px; | 24 width: 100px; |
25 margin: 50px; | 25 margin: 50px; |
26 background-color: blue; | 26 background-color: blue; |
27 -webkit-transform: translateZ(0); | 27 transform: translateZ(0); |
28 -webkit-animation: fade 1s infinite linear alternate; | 28 -webkit-animation: fade 1s infinite linear alternate; |
29 } | 29 } |
30 | 30 |
31 .moved .box { | 31 .moved .box { |
32 -webkit-animation-play-state: paused; | 32 -webkit-animation-play-state: paused; |
33 } | 33 } |
34 | 34 |
35 @-webkit-keyframes fade { | 35 @-webkit-keyframes fade { |
36 from { -webkit-transform: rotate(-20deg); } | 36 from { transform: rotate(-20deg); } |
37 to { -webkit-transform: rotate(20deg); } | 37 to { transform: rotate(20deg); } |
38 } | 38 } |
39 </style> | 39 </style> |
40 <script type="text/javascript" charset="utf-8"> | 40 <script type="text/javascript" charset="utf-8"> |
41 | 41 |
42 function runTest() | 42 function runTest() |
43 { | 43 { |
44 var box = document.querySelectorAll('.box')[0]; | 44 var box = document.querySelectorAll('.box')[0]; |
45 var container = document.querySelectorAll('.container')[0]; | 45 var container = document.querySelectorAll('.container')[0]; |
46 | 46 |
47 window.setTimeout(function() { | 47 window.setTimeout(function() { |
(...skipping 14 matching lines...) Expand all Loading... |
62 </head> | 62 </head> |
63 <body> | 63 <body> |
64 | 64 |
65 <p>Box should animate smoothly left, then right then left again, and not jump at
the end.</p> | 65 <p>Box should animate smoothly left, then right then left again, and not jump at
the end.</p> |
66 <div class="container moved"> | 66 <div class="container moved"> |
67 <div class="box"></div> | 67 <div class="box"></div> |
68 </div> | 68 </div> |
69 | 69 |
70 </body> | 70 </body> |
71 </html> | 71 </html> |
OLD | NEW |