Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,077
    Thanks
    38
    Thanked 498 Times in 492 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •