homepage Welcome to WebmasterWorld Guest from 54.237.184.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Slide Show , add captions
DLadybug




msg:609517
 4:45 am on Jul 1, 2003 (gmt 0)

I need to add captions to this script. I have read I need to add a new array but I don't know where in this script to add it. (or exactly how) And I'm sure I need something to call text from the captions list? Also, if I use this as an external script, would the captions array be embedded here or should it be a second script, and if so, how do you get them to time the pics and captions together?

I also read something about needing a form or text area. I have a css div, will I be changing that div to a form?

Sorry it's so long, I took out the references to the other 59 pics in the list, but didn't know what else I could shave out

Dian :)

<script language="JavaScript">

var interval = 1000;
var random_display = 0;
var image_dir = "bbq/";
var ImageNum = 0;
imageArray = new Array();

imageArray[ImageNum++] = new imageItem(image_dir + "01.jpg");
imageArray[ImageNum++] = new imageItem(image_dir + "02.jpg");

var number_of_image = imageArray.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function randNum(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
ImageNum = randNum(0, number_of_image-1);
}
else {
ImageNum = (ImageNum+1) % number_of_image;
}
var new_image = get_ImageItemLocation(imageArray[ImageNum]);
return(new_image);
}

function getPrevImage() {
ImageNum = (ImageNum-1) % number_of_image;
var new_image = get_ImageItemLocation(imageArray[ImageNum]);
return(new_image);
}

function prevImage(place) {
var new_image = getPrevImage();
document[place].src = new_image;
}

function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
timerID = setTimeout(recur_call, interval);
}
</script>

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved