Slide Show with JavsScript

  1. %@ Page Language="C#" AutoEventWireup="true" CodeBehind="SlideShow.aspx.cs" Inherits="jqDrag1.SlideShow" %>  
  2. <!DOCTYPE html>  
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head runat="server">  
  5. <title>Slide Show</title>  
  6. <script type="text/javascript">  
  7. var images = ["images/Desert.jpg""images/Jellyfish.jpg""images/Koala.jpg""images/Chrysanthemum.jpg""images/Hydrangeas.jpg""images/Lighthouse.jpg""images/Penguins.jpg""images/Tulips.jpg"];  
  8. var imagesarraylength = images.length - 1;  
  9. var i = 0;  
  10. var int = setInterval(function () { tick() }, 1000);  

  11. function tick()
  12. {  
  13.       i = i + 1;  
  14.       if (i > imagesarraylength)
  15.       {  
  16.             i = 0;  
  17.       }
  18.   
  19.       document.getElementById("SlideShow").src = images[i];  
  20. }
  21.   
  22. </script>  
  23. </head>  
  24. <body>  
  25. <form id="form1" runat="server">  
  26. <div>  
  27. <img src="images/Desert.jpg" height="600" width="100%" id="SlideShow" alt="#"/>  
  28. </div>  
  29. </form>  
  30. </body>  
  31. </html>