Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-07-2011, 07:12 PM   PM User | #1
EM Mudder
New to the CF scene

 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
EM Mudder is an unknown quantity at this point
Adding an ALT tag on a carousel banner image (.js)

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?
EM Mudder is offline   Reply With Quote
Old 10-07-2011, 09:20 PM   PM User | #2
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,765
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
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.
jmrker is offline   Reply With Quote
Old 10-07-2011, 09:44 PM   PM User | #3
EM Mudder
New to the CF scene

 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
EM Mudder is an unknown quantity at this point
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.
EM Mudder is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:47 AM.


Advertisement
Log in to turn off these ads.