Hi,

i have the following example which has a java script timeer to move a
DIV block 20 pixels to the left every 20msec.

Can you please tell me where is the code which trigger the repaint?
for the DIV tag gets updated?

Thank you.



<body>
<script type="text/javascript">

var foo = null; // object

function doMove() {
  foo.style.left = parseInt(foo.style.left)+1+'px';
  setTimeout(doMove,20); // call doMove in 20msec
}

function init() {
  foo = document.getElementById('fooObject'); // get the "foo" object
  foo.style.left = '0px'; // set its initial position to 0px
  doMove(); // start animating
}


window.onload = init;

</script>
</head>

<body>

<h1>Javascript animation: Demo 1</h1>
<h2>Recursive setTimeout-based animation</h2>

<div id="fooObject">
 I am foo.
</div>

</body>
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to