Need a Java Script

reicherb

Platinum Member
Nov 22, 2000
2,122
0
0
I need a script that will rotate through a list of images. I need it to start when the page loads, and I need the images to have a description that rotates with them. I have seen scripts with some of these features but not one with all of them.

Can anybody point me to such a script?

Thanks.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
this link will get you started ....
right now i'm too lazy to put up a script, but you can edit that so the call to functions previousPicture() and nextPicture() does not depend on user's click, but you can use it with setTimeout() like this:
setTimeout (nextPicture(), n_milisecond);
where n_milisecond is the number of milisecond you want to wait until it loads the next image...

i'll see if i have time to put out some more tomorrow ....

-988-
 

reicherb

Platinum Member
Nov 22, 2000
2,122
0
0
I'm a java newbie and am not sure how to make those changes. If you could help me out I would appreciate it.

Thanks.

Here is what I'm working on. I'd like to label the rotating images.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
i don't really think there's a way to rotate the caption for the images, unless:
- the captions are made as part of the rotating image
- the captions are also images that will get rotated the way the images are (just put them in the same functions)
- the captions are put in a textbox (form), and get changed with every image rotation

i know there's an easier way to put them there as layers, so you can just put plain text and not worry about creating images and/or using forms (which will make the captions look ugly)... but i'm not at that level yet, so i can't suggest anything on that..... maybe it's time for me to learn.... hmm....

-994-
 

reicherb

Platinum Member
Nov 22, 2000
2,122
0
0
I tried using the script twice. Once for the images, and once for the captions, but there seemed to be a conflict with the variables I assume and only one of the scripts would work.
 

kt

Diamond Member
Apr 1, 2000
6,032
1,348
136
to do the caption rotation, just enclose the caption inside a DIV tag and a ILAYER tag. You need both to make it cross-browser compatible. then you can access the caption text using Javascript, ie:

<div id="caption"><ilayer name="caption"><layer name="caption1">your caption here</layer></ilayer></div>

your javascript function to change your caption text would look something like this:

function changeCaption(captionNum) {

captionArray = new Array();

captionArray[0] = 'caption text 1';
captionArray[1] = 'caption text 2';

captionChange = captionArray[captionNum];

// For IE5,6; NN6; Mozilla compatibility

if (document.getElementById) {
document.getElementById("caption").innerHTML=captionChange;
return true; // exit function
}

// For IE4-6
if(document.all) {
// Type 2: For document.all stands IE4-6 and Opera5, but IE5,6 were gone as the 1-st type
document.all.title.innerHTML=captionChange;
return true; // exit function
}

// For NS4
if (document.layers) {
document.caption.document.caption1.document.write(captionChange)
document.caption.document.caption1.document.close()
return true; // exit function
}
}

Just call the above function when you rotate your images. Good luck.