Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    2
    Member #
    11956
    Hi
    I am trying to put a slideshow of about 6 pictures on to a web page but don't know hoe to go about it. When the page is opened I want the slideshow to start automatically.
    Any help is appreciated, thanks

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hey, I created similar for my niece, Katie

    Here is the code, the bits you need to change are noted with a comment //

    Code:
    <html>
    
    <head>
    
    <title>Slideshow</title>
    
    <script type="text/javascript">
    
    // define all images here to prevent delay
    
    var image1=new Image();
    var image2=new Image();
    var image3=new Image();
    var image4=new Image();
    var image5=new Image();
    var image6=new Image();
    
    image1.src="1.jpg"; // change these to match your images - note these are relative to where this file is (have images in same directory)
    image2.src="2.jpg";
    image3.src="3.jpg";
    image4.src="4.jpg";
    image5.src="5.jpg";
    image6.src="6.jpg";
    
    var num = 1;
    ID = window.setTimeout("Img();",1000);
    var captions = new Array(6);
    
    captions[1] = "";
    captions[2] = "";
    captions[3] = "";
    captions[4] = "";
    captions[5] = "";
    captions[6] = "";
    function Img() {
    
    document.images[0].src = num + '.jpg';
    document.getElementById("caption").innerHTML = captions[num];
    ID = window.setTimeout("Img();",5000);
    num++;
    
    if (num==7){ // if it reaches last image, go back to start
    location.href='index.htm';}
    
    }
    
    </script>
    
    </head>
    
    <body>
    
    <p style="font-family: verdana; font-size: 16px; font-weight: bold; letter-spacing: 5px;">Slideshow</p>
    
    <img src="empty.gif" width="288" height="352">
    
    <p style="font-family: verdana; font-size: 14px; font-weight: 900;">Caption:</p>
    
    <div id="caption" style="font-size: 14px; font-family: verdana;"></div>
    
    </body>
    
    </html>
    That has captions, if you want dont want them just say and I will tweak it for you.

    Hope this helps

  4. #3
    Junior Member
    Join Date
    Nov 2005
    Posts
    2
    Member #
    11956
    thanks very much for your help bfsog


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:19 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com