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 = [

Can anyone help?

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 = [

var urlList = [

/*** 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 );

* 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.