Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript code for slideshow

    I'm building a web site on GeoCities Pro and entered the javascript code for a Random Image Slideshow. The pictures have been uploaded and I have entered the script in 4 different places provided by GeoCities but nothing works. All I see is a box in the body of the page that contains my script. I'm new at all of this sooo please help me. What am I doing wrong???? Thank you.

  • #2
    New Coder
    Join Date
    Nov 2006
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please post the script that you are currently using and a link to your webpage. I can't really offer any suggestions without seeing your script.

  • #3
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript code for slideshow

    This is the site where I got the code: http://www.javascriptkit.com/script/...domslide.shtml The website isn't online at this time because the content isn't finished. Thanks for answering me.

  • #4
    New Coder
    Join Date
    Nov 2006
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Copy all of the code below and paste it into a text editor like notepad. Save it as test.htm and open it in your browser to view the slideshow example.
    Code:
    <html>
    <body>
    <script language="javascript">
    
    /*
    Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
    For this script and more, visit http://www.javascriptkit.com
    */
    
    var delay=1000; //set delay in miliseconds
    var curindex=0;
    
    /*Edit the urls listed in the randomimages array to reflect your own images. You can
    add as many as you need.  Simply add a comma at the end of each url and enclose each 
    url in quotes. I would recommend using the full url instead of just the filename to
    insure that you are referencing the correct location of the image.*/
    
    var randomimages=["http://codingforums.com/images/buttons/edit.gif",
    		  "http://codingforums.com/images/buttons/quote.gif",
    		  "http://codingforums.com/images/buttons/multiquote_off.gif"];
    
    var preload=[],img,curindex,tempindex;
    
    for (var n=0;n<randomimages.length;n++)
    {
    	img=new Image();
    	img.src=randomimages[n];
    	preload.push(img);
    }
    
    document.write('<img name="defaultimage" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'">');
    
    function rotateimage()
    {
    	if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length)))){
    		curindex=curindex==0 ? 1 : curindex-1;
    	} else {
    		curindex=tempindex;
    	}
    
    	document.images.defaultimage.src=randomimages[curindex];
    }
    
    window.setInterval(rotateimage,delay);
    </script>
    </body>
    </html>

  • #5
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript code for slideshow

    Thanks for your reply. I did what you requested and added the script to the designated site on GeoCities but again, all it did was give me a blank box on the site. Please help! I'm lost.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •