...

View Full Version : Adding an ALT tag on a carousel banner image (.js)



EM Mudder
10-07-2011, 08:12 PM
I'm having the same trouble with adding an ALT tag to the last image:

var imageList = [
"images/banner/banner1.jpg",
"images/banner/banner2.jpg",
"images/banner/banner3.jpg",
"images/banner/banner4.jpg",
"images/banner/banner4.jpg",
];

Can anyone help?

jmrker
10-07-2011, 10:20 PM
Where is the rest of your code?
All you have is an array of images.

Where are the images and what are the ALT tags supposed to say?

Note: The last image is the same as the next-to-last. Is that by design?

Also note that the last element of an array should NOT have the comma (,) in the definition
as this indicates there is one more image (which in this case is not defined).
This is probably the main problem, but it is just a guess without the rest of your code.

EM Mudder
10-07-2011, 10:44 PM
I want to add a simple alt description to the jpgs upon hover over:

/*** Image src URLs, update "size" attribute of carousel**/
var imageList = [
"images/banner/banner1.jpg",
"images/banner/banner2.jpg",
"images/banner/banner3.jpg",
"images/banner/banner4.jpg",
"images/banner/banner4.jpg",
];

var urlList = [
"index.jsp?path=login&p=home",
"index.jsp?path=register&p=home",
"index.jsp?path=request-login&p=home",
"index.jsp?path=to&ID=,Green.Eco.Friendly",
];


/*** What to do when a number is clicked***/
var hero_carousel = {

clickCallback: function( event, data ) {
var carousel = data.carousel;
var i = data.where;
data.carousel.scrollTo( data.where );
data.carousel.stopAutoPlay();
}
};


/**
* Generate the links to the various pages, and disable the curent page link
*/
function generateIndex( current, max, carousel )
{
var indexStr = "<div class='indicator'>";

var indicator = YAHOO.util.Dom.get("indicator");
indicator.innerHTML = "";

for (var i = 1; i < max; i++) {

var indexItem;

It all works beautifully by design, expect for the alt tag. Can't seem to make it work.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum