...

View Full Version : disappear tooltip on mouseout event



tanvirtonu
06-18-2009, 10:53 PM
Can anybody tell me how to disappear the popup on mouseout event.I tried but failed.It will show a tooltip/popup on mouseover event but is not going away on mouseout event.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<SCRIPT TYPE="text/javascript">
<!--
Xoffset=-60; // modify these values to ...
Yoffset= 20; // change the popup position.

var old,skn,iex=(document.all),yyy=-1000;

var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all

if (ns4)
skn=document.infobox
else if (ns6)
skn=document.getElementById("infobox").style
else if (ie4)
skn=document.all.infobox.style
if(ns4)document.captureEvents(Event.MOUSEMOVE);
else{
skn.visibility="visible"
skn.display="none"
}
document.onmousemove=get_mouse;

function msgbox(msg,bak) {
var content="<table width=300 border=1 bordorcolor=black cellpadding=2 cellspacing=0 "+
"bgcolor="+bak+"><tr align=left><td width=100%><font color=#404040 size=2><b><i>Pack Download Command</i></b></font><br><font color=#404040 size=1>Copy the following text into your clipboard and<br>once in the channel hit CTRL+V to paste it!</font></td></tr><tr align=left><td width=100%><font color=black size=2>"+msg+"</font></td></tr></table>";
yyy=Yoffset;
if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
if(ns6){document.getElementById("infobox").innerHTML=content;skn.display=''}
if(ie4){document.all("infobox").innerHTML=content;skn.display=''}
}

function get_mouse(e){
var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
skn.left=x+Xoffset;
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
skn.top=y+yyy;
}

function die(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}

//-->
</SCRIPT>
</head>

<body>
<DIV id="infobox">MOUSE HERE</DIV>
<a href="http://some_link.htm" onmouseover="msgbox('Message Text Here','#E6E6BE')"; onmouseout="die()">Link Text</a>

</body>
</html>

Old Pedant
06-19-2009, 12:03 AM
Do you *REALLY* care about NS 4 and MSIE 4 browsers????

tanvirtonu
06-19-2009, 09:36 AM
Do you *REALLY* care about NS 4 and MSIE 4 browsers????
Actually I got it from somewhere else.i just want to make it work.Could u just correct the code?

abduraooft
06-19-2009, 09:38 AM
Check something from http://www.google.com/search?q=dynamic+drive+dhtml+tooltip



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum