Javascript : repeat function not work
<p>I wrote this function to fly DIV from top right to bottom left:</p>

<pre><code>var myObj;

function infly() {
    myObj=document.getElementById('mydiv');
    myObj.style.right='0px';
    myObj.style.top='0px';
}

function flyer() {  
    var x=parseInt(myObj.style.right);
    var y=parseInt(myObj.style.top); 

    x+=1;
    y+=1;  

    myObj.style.right=x+'px';
    myObj.style.top=y+'px'; 

}

function repeat()
{
setTimeout(flyer,5000)
}
</code></pre>

<p>And HTML code is:</p>

<pre><code>&lt;body onLoad="infly()"&gt;

&lt;div id="mydiv"&gt;
&lt;/div&gt;

&lt;a href="" onClick="javascript:repeat()"&gt;Fly&lt;/a&gt;

...
..
.
</code></pre>

<p>But <code>repeat</code> function not work. When I remove this function in every click my DIV fly correctly.</p>

<p>I try with <code>setInterval('fly();', 10);</code> but no success.</p>

<p>Thanks for any helps.</p>

<hr>

<p>Update:</p>

<p>I edit the code and correct <code>repeat</code> function but still not work.</p>
