Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    11

    Unanswered: How do I add a "title" for images to this image javascript?

    Hello, here is some image javascript I am using to show an image that I insert
    and also a link to a different page when you click on the image.

    I need to know how I would show a title for each image when the image is hovered over to add to this script. I think I need a new document.getElement, but I don't know how to incorporate it. Here is the script as it is now. Thank you very much!! Jen

    arr=[

    ["image1.gif","page1.htm"],
    ["image2.gif","page2.htm"], // no comma at the end of last index
    ]

    now=new Date()
    nowDate=now.getDate()

    function changeImg(){

    if(nowDate>arr.length){
    return
    }

    document.getElementById("img").src=arr[nowDate-1][0]
    document.getElementById("link").href=arr[nowDate-1][1]

    }

    And this goes in the body section of the page...

    <BODY onload="changeImg()">

    <a href="#" id="link" target="_blank"><img border="0" id="img"></a>
    http://www.NOSPAMMERSPLEASE.com

    Affordable web design, web application development, content management systems and ecommerce solutions for small business

  2. #2
    Join Date
    Jan 2005
    Posts
    362

    alt

    What do you mean title? "alt"?
    You may use that some.setattribute(’alt’,some)
    url.
    And this is not a javascript forum.
    Dimis

  3. #3
    Join Date
    Aug 2006
    Posts
    1
    what are the jbase web builder basic routine writing

Posting Permissions

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