www.webdeveloper.com
Results 1 to 9 of 9

Thread: Image in ALT when hovering over text

  1. #1
    Join Date
    Nov 2002
    Location
    Omaha, NE
    Posts
    3

    Image in ALT when hovering over text

    Could somebody PLEASE help me find the code to have an image in the ALT when hovering over text? I found this code long ago on JavaScriptSource, but lost it, now cannot find it again. Thanks for any help! I GREATLY appreciate it!

  2. #2
    Join Date
    Nov 2002
    Location
    England
    Posts
    275

    Re: Re: Image in ALT when hovering over text

    Originally posted by Dave Clark
    ...only the IMG tag has an alt attributeDave
    Don't forget the input element does too

  3. #3
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    [P]lease keep in mind that HTML 4+ is very new and not all current browsers support it or support all of it.
    The HTML 4.0 Recommendation came out 18 December 1997 and was superseded by HTML 4.01 24 December 1999. That's quite a long time ago considering that HTML 3.2 came out 14 January 1997.

    But hat doesn't mean that one ought to use the ALT attribute for the pop up thingy that's also called a tool tip. Said attribute is supposed to provide an alternative text for when the image cannot be rendered, as with a Braille browser http://www.w3.org/TR/html401/struct/....html#adef-alt ). Use the TITLE attribute instead ( http://www.w3.org/TR/html401/struct/...tml#adef-title ).

  4. #4
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    Sorry if I offended you, I was only adding a comment, which I though may help you.

  5. #5
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Rick,

    Yes, you and I were commenting on replys to the original post and not the original post itself, just as Mr. Clark was doing when he upbraided us for doing so.

  6. #6
    Join Date
    Nov 2002
    Location
    Omaha, NE
    Posts
    3

    Unhappy

    OKAY! I did not necessarily mean HTML, its a JavaScript (hence the posting here). I've seen it and used it before and it worked. What I want to do is have a link... When hovering over the link, and image show up, but not in a new window, more like in an "ALT" mode. Supposing I didn't make myself clear. Here's where I want to put it (assuming my computer doesn't freeze and you can view this page):

    http://68.13.179.122:59143/koaxweather/currenttemps.htm

    When you hover over a city on the map, it shows the current conditions. However, I want to put all of those images at the bottom for each city in the hover message as well. This page is currently 100% HTML, but I want to add the JavaScript which will do this. Thanks!

  7. #7
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    If I'm looking at the right thing, it looks like the title attribute to me (as was suggested by Charles I think earlier):

    Code:
    <img src="image.png" alt="" title="Your popup text here">

  8. #8
    Join Date
    Nov 2002
    Posts
    631
    You can't put an image in the alt attribute.

  9. #9
    Join Date
    Nov 2002
    Location
    Omaha, NE
    Posts
    3

    Wink

    Okay, okay, okay! I get it now. I just can't figure out where to put the HTML code for an image. Could you help me out on this one? Thanks!

    Originally posted by Dave Clark
    My original post is the solution to your need:

    http://developer.netscape.com/viewso...lloonhelp.html

    This is the only "ALT"-like or TITLE-like structure that is going to allow you to show an image and a link -- as a hovering structure -- when an onMouseOver event is fired. Neither ALT nor TITLE will let you show anything except text. The above link is not for something that pops up in a new window. It is a DHTML (HTML/JavaScript) structure (DIV block) that can also contain HTML within it. It pops up in the same manner that the text content of an ALT or a TITLE pops up -- except that, as I said, it can show rendered HTML to boot.

    Dave

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles