View Full Version : javascript code for slideshow

11-30-2006, 08:15 PM
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.

11-30-2006, 11:49 PM
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.

12-01-2006, 12:36 AM
This is the site where I got the code: http://www.javascriptkit.com/script/script2/randomslide.shtml The website isn't online at this time because the content isn't finished. Thanks for answering me.

12-01-2006, 02:45 AM
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.

<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",

var preload=[],img,curindex,tempindex;

for (var n=0;n<randomimages.length;n++)
img=new Image();

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 {



12-03-2006, 11:21 PM
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.