autoHide - Panel Control

microkarl

Regular
Joined
Apr 22, 2004
Messages
88
Location
Morristown, NJ
Hi everyone,
I am using Panel control as a horizontal menu on a web page. Everything looks great but I have one question, can the panel close itself whenever I hover away from the panel, as well as the button that calls the panel?


See attached code:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <title>WebForm1</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
     <script language="JScript">
		var oPopup = window.createPopup();
		function ButtonHover()
		{
			var oPopBody = oPopup.document.body;
			oPopBody.style.backgroundColor = "lightyellow";
			oPopBody.style.border = "solid black 1px";
			oPopBody.innerHTML = "Click outside to close it.";
			oPopup.show(40, 40, 180, 25, document.body);
		}
	</script>
  </head>
  <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
		<BUTTON  onmouseover="ButtonHover()">Hover me!</BUTTON>
    </form>
  </body>
</html>
 
oPopBody.style.display = 'none';

and

oPopBody.style.display = '';

Those should do it for you for the javascript, just put them in seperate functions then use mouseover to call the one that shows it and mouseout to hide the one that hides it.
 
Back
Top