title: javascrtipt Slideshow
body: <p>I made this Slideshow but i have a problem with repeating  the images for now it just go from image 1 to 2 and stop there!! any ideas? i tried  with  <code>if(i==2){i = 1;}</code> after the loop but not working.</p>
  
  <pre><code>var i = 1;
  var myVar = setInterval(function () {
      myCarousel()
  }, 2000);
  
  function myCarousel() {
      while (i &lt;= 2) {
          var img = "&lt;img src='images/game" + i + ".jpg' height='250px;' width='100%;'/&gt;";
          document.getElementById("images").innerHTML = img;
          i++;
      }
  }
  </code></pre>