snippet library logo
Amazon.com
in category
Javascript / OnMouseover / The Simplest Tooltip
Snippet details
ID: 81
Viewed: 1415
Added: 2002-02-13
Version:
View Demo

User Rated at:
Rate This:
Snippets in this catagory         
Show Printable Version
Very easy tool tip that will display a Tool Tip when mouseover on a link.

Browsers: IE5.0+ & NS4.xx & NS6.x

General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: Unknown

<!---Head--->
<HTML><HEAD>

<SCRIPT language=JavaScript>

function showtip(current,e,text)
{
        if (document.all)
        {
                thetitle=text.split('<BR>')

                if (thetitle.length>1)
                  {
                        thetitles=''
                       for (i=0;i<thetitle.length;i++)
                        thetitles+=thetitle[i]
                        current.title=thetitles
                }
                else
                        {current.title=text}
        }
        else if (document.layers)
                {
                document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
                document.tooltip.document.close()
                document.tooltip.left=e.pageX+5
                document.tooltip.top=e.pageY+5
                document.tooltip.visibility="show"
                }

}


function hidetip()
{
        if (document.layers)
        document.tooltip.visibility="hidden"
}

</SCRIPT>

<STYLE type=text/css>
        A {COLOR: blue; TEXT-DECORATION: none}
        A:hover {COLOR: orange; TEXT-DECORATION: none}
</STYLE>
</HEAD>

<!---Body--->


<BODY>
      <DIV id=tooltip style="VISIBILITY: hidden; POSITION: absolute"></DIV>
      <A href="link.html" onmouseover="showtip(this,event,'this is a working tooltip')" onmouseout=hidetip()>Run your mouse over here !!!</a>
</BODY>
</HTML>




No Reviews to show


Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Subject:

Reviewed By:

Write a review:





Terms of Conditions
Powered By
Avian Hosting
© 2005 snippetlibrary.com All Rights Reserved.