add more spacing
[personal-kdebase.git] / workspace / plasma / scriptengines / webkit / tests / AppletAnimatorTest.html
blobd450c8dabd34916030c746513b567d661debf9d5
1 <html>
2 <head>
3 <script type="text/javascript" src="AppleClasses/AppleAnimator.js" charset='utf-8'></script>
4 <script>
5 function colorchanger(animation, cur, from, to)
7 var box = document.getElementById('testbox');
8 box.style.background = 'rgb(127,0,' + parseInt(cur) + ')';
9 };
11 function boxchanger(animation, cur, from, to)
13 var box = document.getElementById('testbox');
14 box.style.left = cur.left + 'px';
15 box.style.top = cur.top + 'px';
16 box.style.width = (cur.right - cur.left) + 'px';
17 box.style.height = (cur.bottom - cur.top) + 'px';
20 window.onload = function ()
22 var element = document.getElementById('testbox');
23 element.style.height = '100px';
24 element.style.width = '250px';
25 element.style.background = 'rgb(127,0,0)';
26 element.style.position = 'absolute';
27 element.style.left = '50px';
28 element.style.top = '100px';
29 var animator = new AppleAnimator(10000,100,0,255,colorchanger);
30 var rectanim = new AppleRectAnimation( new AppleRect(50,100,400,200), new AppleRect(75,100,500,300), boxchanger);
31 animator.addAnimation(rectanim);
32 animator.start();
34 </script>
35 </head>
36 <body>
37 <div id="testbox"></div>
38 </body>
39 </html>