How do you creat a rollover text message, like the one when you hold your mouse over.

Discussion in 'HTML & Website Design' started by adsensenewb, Feb 15, 2006.

  1. #1
    How would you create a little text bar that pops up when you hold your mouse over a 'hotspot' Just like when you hold your mouse over a user names 'green bars' and it says " 'Bob jones' is a jewel in the rough "or somthing like that.

    I know you just add a javascript behavior to a hotspot, but which one?
     
    adsensenewb, Feb 15, 2006 IP
  2. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #2
    Do you just mean a tool tip?

    If so you can use the title attribute.

    Or if you want a more complex version you can use DHTML.

    If this forum would let me post a link I would give you some links but hey.
     
    johneva, Feb 15, 2006 IP
  3. NetMidWest

    NetMidWest Peon

    Messages:
    1,677
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #3
    For an image:
    <img src="http://www.somedomain.tld/img/image.gif" alt="Text goes here">
    For a hyperlink:
    <a href="http://www.somedomain.tld/" title="Text goes here">
     
    NetMidWest, Feb 15, 2006 IP
  4. studio606

    studio606 Peon

    Messages:
    110
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try the title tag like this in your link:

    <A href="http://www.yahoo.com/" title="Go to Yahoo">Yahoo</A>

    Edit: NetMidWest has it as well, posted it while I was writing it out. Thanks.
     
    studio606, Feb 15, 2006 IP
  5. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    NO! Use the TITLE attribute even in images. The ALT attribute has a specific, and entirely different purpose. Getting a tooltip of ALT text is something that happens in IE only, and really shouldn't happen at all.
     
    FeelLikeANut, Feb 15, 2006 IP
    kk5st likes this.
  6. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #6
    Yep the alt attribute is just to display the text alternative for when images are not showen.

    Tile is what should be used unless you want a more complex tool tip the you can use DHTML.

    Type in tool tip in Google and there are a few tuts on how to do this.

    I would post a direct link to one but I still carnt yet as I am a newbie here.
     
    johneva, Feb 16, 2006 IP
  7. KGL

    KGL Peon

    Messages:
    1,155
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Cool.
    This helped me out alot as well.
     
    KGL, Feb 28, 2006 IP