0 Replies Latest reply on Mar 12, 2010 12:05 PM by mmrdesigner

    How can I add Autoplay function to my javascript slideshow?



      I'd like to have this slideshow automatically play (rather than having to click "play/stop")

      on my website: http://www.logicadesign.com (click "Slideshow 09" on left to view).

      Is there a line of code I can add to the code below?



      <html xmlns="http://www.w3.org/1999/xhtml">
      <title>Untitled Document</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <link href="logica.css" rel="stylesheet" type="text/css">
      <SCRIPT LANGUAGE="JavaScript">
      <!-- Begin
      NewImg = new Array (
      var ImgNum = 0;
      var ImgLength = NewImg.length - 1;
      //Time delay between Slides in milliseconds
      var delay = 2500;
      var lock = false;
      var run;
      function chgImg(direction) {
      if (document.images) {
      ImgNum = ImgNum + direction;
      if (ImgNum > ImgLength) {
      ImgNum = 0;
      if (ImgNum < 0) {
      ImgNum = ImgLength;
      document.slideshow.src = NewImg[ImgNum];
      function auto() {
      if (lock == true) {
      lock = false;
      else if (lock == false) {
      lock = true;
      run = setInterval("chgImg(1)", delay);
      //  End -->
      <table width="648" border="0" cellpadding="0" cellspacing="0">
          <td width="648" height="20" align="left" valign="baseline" nowrap><a href="javascript:chgImg(-1)" class="text">Prev</a> <span class="text">|</span> <a href="javascript:auto()" class="textgreen">Play/Stop</a> <span class="text">|</span> <a href="javascript:chgImg(1)" class="text">Next</a></td>
          <td height="10" align="left" valign="top" nowrap></td>
        <td height="486" align="left" valign="top" nowrap><img src="NewWork09/1.jpg" name="slideshow" width="648" height="487"></td>