OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <head> | |
3 <script> | |
4 var remainingFrames; | |
5 function runTest() | |
6 { | |
7 remainingFrames = 5; | |
8 requestAnimationFrame(onFrame); | |
9 } | |
10 | |
11 var lastOffset = 0; | |
12 function onFrame() | |
13 { | |
14 var div = document.getElementById("test"); | |
15 lastOffset = (lastOffset + 20) % 200; | |
yurys
2013/02/25 09:13:48
Inconsistent alignment, also it is 2 spaces in Chr
| |
16 div.style.left = lastOffset + "px"; | |
17 if (--remainingFrames) | |
18 requestAnimationFrame(onFrame); | |
19 else | |
20 done(); | |
21 } | |
22 | |
23 function done() | |
24 { | |
25 console.timeStamp("ready"); | |
26 } | |
27 | |
28 </script> | |
29 </head> | |
30 <body> | |
31 <div id="test" style="position: absolute; width: 20px; height: 20px; background- color: blue;"></div> | |
32 </body> | |
33 </html> | |
OLD | NEW |