1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Java Script Slide Show

Discussion in 'Web Design & Development' started by thecoolest2009, Jan 12, 2011.

Thread Status:
Not open for further replies.
  1. thecoolest2009

    thecoolest2009 Thread Starter

    Joined:
    Sep 25, 2009
    Messages:
    17
    Hi,

    I've created a java script slide show for my website, but for some reason, I can only get three of the photos to appear in my slideshow. It just keeps rotating through the first three photos.

    How do I get the remaining 12 photos to appear in the slideshow? I would be willing to take suggestions for free slideshow creators that don't have their logo plastered across every photo.

    See the code below.

    <html>
    <head>
    <script type="text/javascript">
    <!--
    var image1=new Image()
    image1.src="http://www.cfn204.com/storage/dropbox/schools/214.jpg"
    var image2=new Image()
    image2.src="http://www.cfn204.com/storage/dropbox/schools/IS%20125.jpg"
    var image3=new Image()
    image3.src="http://www.cfn204.com/storage/dropbox/schools/IS%2093.jpg"
    var image4=new Image()
    image4.src="http://www.cfn204.com/storage/dropbox/schools/PS%20%20128.jpg"
    var image5=new Image()
    image5.src="http://www.cfn204.com/storage/dropbox/schools/PS%20091.jpg"
    var image6=new Image()
    image6.src="http://www.cfn204.com/storage/dropbox/schools/PS%20091.jpg"
    var image7=new Image()
    image7.src="http://www.cfn204.com/storage/dropbox/schools/PS%20102.jpg"
    var image8=new Image()
    image8.src="http://www.cfn204.com/storage/dropbox/schools/PS%20107.jpg"
    var image9=new Image()
    image9.src="http://www.cfn204.com/storage/dropbox/schools/PS%20164.jpg"
    var image10=new Image()
    image10.src="http://www.cfn204.com/storage/dropbox/schools/PS%2019.jpg"
    var image11=new Image()
    image11.src="http://www.cfn204.com/storage/dropbox/schools/PS%2020.jpg"
    var image12=new Image()
    image12.src="http://www.cfn204.com/storage/dropbox/schools/PS%20201.jpg"
    var image13=new Image()
    image13.src="http://www.cfn204.com/storage/dropbox/schools/PS%2028.jpg"
    var image14=new Image()
    image14.src="http://www.cfn204.com/storage/dropbox/schools/PS%2086.jpg"
    var image15=new Image()
    image15.src="http://www.cfn204.com/storage/dropbox/schools/PS150.jpg"
    //-->
    </script>
    </head>
    <body>
    <img src="214.jpg" name="slide" width="500" height="500" />
    <script>
    <!--
    //variable that will increment through the images
    var step=1
    function slideit(){
    //if browser does not support the image object, exit.
    if (!document.images)
    return
    document.images.slide.src=eval("image"+step+".src")
    if (step<3)
    step++
    else
    step=1
    //call function "slideit()" every 2.5 seconds
    setTimeout("slideit()",2500)
    }
    slideit()
    //-->
    </script>
    </body>
    </html>
    &#12288;
     
  2. DrP

    DrP

    Joined:
    Jul 23, 2005
    Messages:
    739
    Change this line of script to reflect the number of images you have:

    Code:
    if (step<3)
    
    If you're wanting something a little slicker, I've used this several times: http://medienfreunde.com/lab/innerfade/
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/974289

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice