Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Mouse Out.

Status
Not open for further replies.

ddfff

MIS
Sep 27, 2002
125
US
Using the following to display pop up message on mouse over.

<SCRIPT LANGUAGE="JScript">
var oPopup = window.createPopup();
function ButtonClick()
{
var oPopBody = oPopup.document.body;
oPopBody.style.backgroundColor = "lightyellow";
oPopBody.style.border = "solid black 1px";
oPopBody.innerHTML = "Click outside <B>popup</B> to close.";
oPopup.show(100, 100, 180, 25, document.body);
}
</SCRIPT>

I want the window to close on "mouse out".

How can I do this?

Thanks in advance.
 
stab in the dark...

<input type="button" onMouseOver="ButtonClick();" onMouseOut="oPopup.window.close();">
 
Have you tried:

onmouseout='if(oPopup)oPopup.close();'

...? Since the oPopup variable is declared globally, you should be able to do this. The if-conditional is merely to ensure that the variable has been set at least once (which, of course, it should with the onmouseover event, but sometimes it's better to be safe!).

--Dave
 
You could place your "popup" in a DIV instead (in the top z-index layer) that is initially hidden. Then make a function to hide the DIV again onMouseOut.

Good Luck


Jakob

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top