title: How to make a repeat move in javascript?
body: <p>I'm using JavaScript to make a progres bar when downloading files. I have done it to move from server to client as a picture, but I don't know how to make it to repeat so the progress will continue. I have used this script. What do I have to do?</p>
  
  <pre><code>&lt;style type="text/css"&gt;
  #apDiv1 {
      position:absolute;
      width:142px;
      height:140px;
      z-index:1;
      background-color: #FFFFFF;
      background-image: url(server.png);
  }
  #apDiv2 {
      position:absolute;
      width:142px;
      height:140px;
      z-index:2;
      left: 500px;
      top: 15px;
      background-color: #FFFFFF;
      background-image: url(laptop.png);
  }
  #apDiv3 {
      position:absolute;
      width:346px;
      height:140px;
      z-index:3;
      left: 153px;
      top: 15px;
  }
  body {
  }
  &lt;/style&gt;
  &lt;div id="apDiv1"&gt;&lt;/div&gt;
  &lt;div id="apDiv2"&gt;&lt;/div&gt;
  &lt;div id="apDiv3"&gt;&lt;br /&gt;
    &lt;script type="text/javascript"&gt;
  &lt;!--
  var imgObj = null;
  var animate ;
  function init(){
     imgObj = document.getElementById('myImage');
     imgObj.style.position= 'relative'; 
     imgObj.style.left = '0px'; 
  }
  function moveRight(){
  imgObj.style.left = 200 + 200 + 'px';
  if (10 &lt;= left) {
  imgObj.style.left = (left + 300) + 'px';
  imgObj.style.visibility='visible';
  
  } else
  
  if (left&gt;=500) {
  imgObj.style.left = '0px';
  }
  }
  function animate(){
  animate = setTimeout(moveRight,200);
  
  }
  window.onload =init;
  //--&gt;
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
  &lt;img src="file:///C|/Documents and Settings/Administrator/Desktop/New Folder (2)/folder.png" width="65" height="67" id="myImage" /&gt;
  &lt;p&gt;Click the buttons below to handle animation&lt;/p&gt;
  &lt;input type="button" value="Shkarko" onclick="moveRight();" /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>