Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange JScript error ... plesae help ! 1

Status
Not open for further replies.

Floof

Technical User
Apr 25, 2001
23
0
0
FR
Hello,

I am trying to set up a Javascript diaporama. It did work, but I've done something that has broken my code, and I can't find what !!

Here's my code :
Code:
<html>

 <!---------------------------------------------------------------->
 <!-- HTML Header -->
 <!---------------------------------------------------------------->
 <head>
  <title>Diaporama</title>
  <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/Templates/hp.css&quot;>
 </head>
 
 <script language=&quot;javascript&quot;>
 <!-- //
      
      var ImgLoaded = &quot;false&quot;;
      var ImgCount = 25;
      var ImgShown = 0;
      var ImgPrefix = &quot;gifs/hot_cdg_&quot;;
      var ImgSufix = &quot;.jpg&quot;;
      var ImgArray = new Array(ImgCount);
      
      var TidDiaporama = 0;
      var DiaporamaPaused = &quot;true&quot;;
      
      function LoadImages ()
      {var i = 1;
       while (i <= ImgCount)
       {if ((i == 2)||(i == 16))
        {ImgArray[i] = new Image (240,360);
        }
        else
        {ImgArray[i] = new Image (360,240);
        }
        ImgArray[i].src = ImgPrefix + i + ImgSufix;
        i++;
       }
       ImgPlay = new Image (32,32);
       ImgPlay.src = &quot;gifs/btn_play.jpg&quot;;
       ImgPause = new Image (32,32);
       ImgPause.src = &quot;gifs/btn_pause.jpg&quot;;
       ImgPrev = new Image (32,32);
       ImgPrev.src = &quot;gifs/btn_prev.jpg&quot;;
       ImgNext = new Image (32,32);
       ImgNext.src = &quot;gifs/btn_next.jpg&quot;;
       ImgLoaded = &quot;true&quot;;
      }
      
      function ShowNext ()
      {if (ImgShown < ImgCount)
       {TagImgShown.src = ImgArray[img]hown + 1[/img].src;
        ImgShown ++;
       }
       else
       {TagImgShown.src = ImgArray[1].src;
        ImgShown = 1;
       }
      }
      
      function ShowPrev()
      {if (ImgShown > 1)
       {TagImgShown.src = ImgArray[img]hown - 1[/img].src;
        ImgShown --;
       }
       else
       {TagImgShown.src = ImgArray[img]ount[/img].src;
        ImgShown = ImgCount;
       }
      }
      
      function StopDiaporama()
      {clearInterval(TidDiaporama);
       DiaporamaPaused = &quot;true&quot;;
       TagImgPlay.src = ImgPlay.src;
      }
      
      function StartDiaporama()
      {TidDiaporama = setInterval(&quot;ShowNext()&quot;,5000);
       DiaporamaPaused = &quot;false&quot;;
       TagImgPlay.src = ImgPause.src;
      }
      
      funtion BTNPlayCallback ()
      {if (DiaporamaPaused == &quot;true&quot;) StartDiaporama();
       if (DiaporamaPaused == &quot;false&quot;) StopDiaporama();
      }
      
      LoadImages();
 // -->
 </script>
 
 <!---------------------------------------------------------------->
 <!-- HTML Body -->
 <!---------------------------------------------------------------->
 <body leftMargin=&quot;0&quot; topMargin=&quot;0&quot; bgcolor=&quot;#FFFFFF&quot;>

  <!---------------------------------------------------------------->
  <!-- Beginning Of Document Table-->
  <!---------------------------------------------------------------->
  <table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;>
   <tr>
    <td width=&quot;1&quot; valign=&quot;top&quot;>

    <!---------------------------------------------------------------->
    <!-- Separation Column -->
    <!---------------------------------------------------------------->
    <td valign=&quot;top&quot; width=&quot;15&quot;><img src=&quot;/gifs/spacer.gif&quot; width=&quot;15&quot;></td>
    
    <!---------------------------------------------------------------->
    <!-- Beginning of central section -->
    <!---------------------------------------------------------------->
    <td valign=&quot;top&quot;>
     <table border=&quot;0&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
         
       <!---------------------------------------------------------------->
       <!-- Separation row -->
       <!---------------------------------------------------------------->
       <tr>
        <td width=&quot;100%&quot; height=&quot;15&quot;></td>
       </tr>
       
       <!---------------------------------------------------------------->
       <!-- Module : &quot;Photos&quot; -->
       <!---------------------------------------------------------------->
       <tr>
        <td width=&quot;100%&quot;>
         <table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>

          <!-- Module Title -->
          <tr>
           <td width=&quot;10&quot; height=&quot;20&quot; valign=&quot;top&quot; class=&quot;ModuleCell&quot;><img src=&quot;/gifs/corner_top_left_trans.gif&quot; width=&quot;10&quot; height=&quot;20&quot;></td>
           <td height=&quot;20&quot; class=&quot;ModuleCell&quot;>
            <span class=&quot;newsheader&quot;>Hot Spot at the Charles de Gaule Airport - Diaporama</span>
           </td>
           <td width=&quot;10&quot; height=&quot;20&quot; align=&quot;right&quot; valign=&quot;top&quot; class=&quot;ModuleCell&quot;><img src=&quot;/gifs/corner_top_right_trans.gif&quot; width=&quot;10&quot; height=&quot;20&quot;></td>
          </tr>

          <!-- Module Separation Row -->
          <tr>
           <td width=&quot;10&quot; height=&quot;15&quot; class=&quot;regular&quot;></td>
           <td height=&quot;15&quot; class=&quot;regular&quot;></td>
           <td width=&quot;10&quot; height=&quot;15&quot; class=&quot;regular&quot;></td>
          </tr>

          <!-- Module Body -->
          <tr>
           <td class=&quot;regular&quot; width=&quot;10&quot;></td>
           <td align=&quot;center&quot; valign=&quot;middle&quot; class=&quot;regular&quot;>
            <img id=&quot;TagImgShown&quot; src=&quot;gifs/loading.jpg&quot;>
           </td>
           <td class=&quot;regular&quot; width=&quot;10&quot;></td>
          </tr>

          <!-- Module Separation Row -->
          <tr>
           <td width=&quot;10&quot; height=&quot;15&quot; class=&quot;regular&quot;></td>
           <td height=&quot;15&quot; class=&quot;regular&quot;></td>
           <td width=&quot;10&quot; height=&quot;15&quot; class=&quot;regular&quot;></td>
          </tr>

          <!-- Module Body -->
          <tr>
           <td class=&quot;regular&quot; width=&quot;10&quot;></td>
           <td align=&quot;center&quot; valign=&quot;middle&quot; class=&quot;regular&quot;>
            <table border=&quot;0&quot; cellspacing=&quot;10&quot; cellpadding=&quot;0&quot;>
             <tr>
              <td><a href=&quot;javascript:alert(ShowPrev);&quot;><img id=&quot;TagImgPrev&quot; src=&quot;gifs/btn_prev.jpg&quot; border=&quot;0&quot;></a></td>
              <td><a href=&quot;javascript:BTNPlayCallback();&quot;><img id=&quot;TagImgPlay&quot; src=&quot;gifs/btn_play.jpg&quot; border=&quot;0&quot;></a></td>
              <td><a href=&quot;javascript:ShowNext();&quot;><img id=&quot;TagImgNext&quot; src=&quot;gifs/btn_next.jpg&quot; border=&quot;0&quot;></a></td>
             </tr>
            </table>
           </td>
           <td class=&quot;regular&quot; width=&quot;10&quot;></td>
          </tr>

          <!-- Module Footer -->
          <tr>
           <td width=&quot;10&quot; valign=&quot;bottom&quot; class=&quot;regular&quot;><img src=&quot;/gifs/corner_btm_left_trans.gif&quot; width=&quot;10&quot; height=&quot;10&quot;></td>
           <td class=&quot;regular&quot;></td>
           <td width=&quot;10&quot; align=&quot;right&quot; valign=&quot;bottom&quot; class=&quot;regular&quot;><img src=&quot;/gifs/corner_btm_right_trans.gif&quot; width=&quot;10&quot; height=&quot;10&quot;></td>
          </tr>
         </table>
        </td>
       </tr>

       <!---------------------------------------------------------------->
       <!-- Central Section End -->
       <!---------------------------------------------------------------->
      </table>
     </td>
     
     <!---------------------------------------------------------------->
     <!-- Right Margin -->
     <!---------------------------------------------------------------->
     <td width=&quot;15&quot;><img src=&quot;/gifs/spacer.gif&quot; width=&quot;15&quot;></td>
   
   <!---------------------------------------------------------------->
   <!-- Main Table End -->
   <!---------------------------------------------------------------->
   </tr>
  </table>
  
  <!---------------------------------------------------------------->
  <!-- HTML Footer -->
  <!---------------------------------------------------------------->
 </body>
</html>

Internet explorer says : on Line 1 char 1 : object expected ...

I anyone has a clue, I would be grateful [sadeyes]

Thanks,
Floof
 

funtion BTNPlayCallback () <-- typo in &quot;function&quot;
{if (DiaporamaPaused == &quot;true&quot;) StartDiaporama();
if (DiaporamaPaused == &quot;false&quot;) StopDiaporama();
} Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top