Results 1 to 3 of 3

Thread: DHTML Tool Tip

  1. #1

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Resolved DHTML Tool Tip

    If I use the Title attribute of the span tag I get a popup tool tip (I think the correct term might be Title Box).
    Unfortunately not all browsers support long tool tips or ones with line breaks in them.

    A replacement for this is a DHTML solution using Javascript and onmouseover.
    http://www.dynamicdrive.com/dynamici...tmltooltip.htm

    Does anyone have a better/smaller/simpler version that is cross browser compliant?

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: DHTML Tool Tip

    I came accross this CSS tool tip here

    Code:
    <style>
      a.info{
        position:relative; /*this is the key*/
        z-index:24; background-color:#ccc;
        color:#000;
        text-decoration:none
      }
      a.info:hover{z-index:25; background-color:#ff0}
      
      a.info span{display: none}
    
      a.info:hover span{ /*the span will display just on :hover state*/
          display:block;
          position:absolute;
          top:2em; left:2em; width:15em;
          border:1px solid #0cf;
          background-color:#AAAA00; color:#000;
          text-align: center
      }
      </style>
      </head>
      <body>
      <a href="" class="info">test<span>Pure CSS Tooltips</span></a>
        
      </body>

  3. #3

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: DHTML Tool Tip

    Top stuff!
    Thanks!
    You can make it work for text as well if you void the link
    Code:
    <A HREF="javascript:void(0)"

Posting Permissions

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



Click Here to Expand Forum to Full Width