This is just a small script that lets you display a set of pictures in a slideshow-like manner. This script lets you show the thumbnailed versions of the pictures, and then when the user clicks on a pic, the user is taken to the actual picture.

NOTE: You can add more pictures to the array by copying the format that is being used in it:

CODE

<html>

<head>
<script language='Javascript' type='text/css'>
<!--

slideshow = new Array(
                              "images/image1.bmp", "images/image2.bmp",
                              "images/image3.bmp", "images/image4.bmp"
                              )

slideNumber = slideshow.length
slideCurrent = 0

function loadSlides()
{
      document.slide.src = slideshow[slideCurrent]
}

function slideNext()
{
      if(slideCurrent < slideNumber)
      {
              slideCurrent ++
              document.slide.src = slideshow[slideCurrent]
       }
      else
      {
             slideCurrent = 0
             document.slide.src = slideshow[slideCurrent]
       }
}

function slidePrevious()
{
      if(slideCurrent > 0)
      {
              slideCurrent --
              document.slide.src = slideshow[slideCurrent]
       }
      else
      {
             slideCurrent = slideNumber - 1
       }
}


function playSlides()
{
      if(slideCurrent < slideNumber)
      {
              slideCurrent ++
              document.slide.src = slideshow[slideCurrent]
              setTimeout("playSlides()", 2500)
       }
      else
      {
             slideCurrent = 0
             document.slide.src = slideshow[slideCurrent]
             setTimeout("playSlides()", 2500)
       }
}

function openPicture()
{
      window.open(slideshow[slideCurrent], "slideWindow")
}

//-->
</script>
</head>

<body onLoad = loadSlides()>

<a href='java script: openPicture()'><img name='slide' width=96 height=96></a><br>
<center>
<a href='java script: slidePrevious()'><img src='prev.bmp'></a>
<a href='java script: slideNext()'><img src='prev.bmp'></a>
<a href='java script: playSlides()'><img src='prev.bmp'></a>
</center>

</body>
</html>



If you need more information, just ask and I'll reply. Good luck with the script and enjoy! If I receive my hosting, I will upload the script to the server and show you what it's supposed to do.

 

 

 


Comment/Reply (w/o sign-up)