...

View Full Version : popup



johns311
04-11-2005, 01:35 AM
I have a popup window using oPopup and the menu is created using <div> in my html code. Here is my javascript code:


function richDropDown(a,b,c,d,e,menu_name)
{
oPopup.document.body.innerHTML = menu_name.innerHTML;
oPopup.show(a,b,c,d,e);
//oPopup.onmouseout=oPopup.hide();
}

I am wondering how to get the popup menu to dissapear automatically once the mouse has left the popup without having to click.

johns311
04-11-2005, 01:44 AM
if onmouseout will work, how do I use that in javascript. It will not work from inside the HTML, because the <div> does not seem to be a single object. It is a list of a bunch of them. If you know what I mean??

johns311
04-11-2005, 03:30 AM
does anyone understand my question or do I need to explain better?

brandonH
04-11-2005, 03:34 AM
i think i understand but i need to see it all, so if you have a link to it or can pos it all please do.

johns311
04-11-2005, 03:49 AM
<html>
<head>
<title>MY popup menu</title>

<script>
var oPopup = window.createPopup();
function richDropDown(a,b,c,d,e,menu_name)
{
oPopup.document.body.innerHTML = menu_name.innerHTML;
oPopup.show(a,b,c,d,e);
}

<p><img src="Picture1.gif" width="800" height="600" border="0" usemap="#Map">

<map name="Map">
<area id=MTU_MAP shape="rect" coords="91,275,171,316" alt="click" onmousedown="richDropDown(30,30,220,150,MTU_MAP,MTU_MENU)"
onmouseover="document.body.style.cursor='hand'; "
onmouseout="document.body.style.cursor=''; ">

</map>

<DIV ID="MTU_MENU" STYLE="display:none" >

<DIV STYLE="font-family:verdana; font-size:80%; height:30px; background:#0066FF; border:1px solid black; padding:0px; text-align:center; border:2px solid black; cursor:hand;">
&nbsp <img src="tridown.gif" align="left"><font size="+1"> <B>MTU Menu&nbsp</B> </font> <img src="tridown.gif" align="right">
</DIV>

<div style="position:absolute; top:30; left:0; overflow:scroll; overflow-x:hidden; width:220; height:120; scrollbar-base-color:#3366CC; border-bottom:2px solid black; SCROLLBAR-HIGHLIGHT-COLOR: #99CCFF; SCROLLBAR-ARROW-COLOR:white;">

<DIV onmouseover="this.style.filter='progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#99ccff, EndColorStr=#FFFFFF)'; this.style.color='red' ;
this.style.fontSize='14'; "
onmouseout="this.style.filter=''; this.style.color='black'; this.style.fontSize='12'; "
STYLE="font-family:verdana; font-size:70%; height:25px; background:#e4e4e4; border:1px solid black; padding:3px; padding-left:20px; cursor:hand;">
<SPAN ONCLICK="">
OV-103</SPAN>
</DIV>
</DIV>
</DIV>


</body>
</html>


I guess you don't have the image file, it uses map then when clicked a dropdown menu opens. Let me know if you know how to solve my problem. THANKS!!

brandonH
04-11-2005, 04:01 AM
ok, so the pop up is a window or the div?


if its a div thats easy to do, just set an onmouseout to the actual div.

<div id=MTU_MENU onmouseout="this.style.visibility='hidden';">

glenngv
04-11-2005, 04:22 AM
oPopup.onmouseout=oPopup.hide;

johns311
04-11-2005, 04:25 AM
ok, so the pop up is a window or the div?


if its a div thats easy to do, just set an onmouseout to the actual div.

<div id=MTU_MENU onmouseout="this.style.visibility='hidden';">

One would think that would work, but I have <DIV ID="MTU_MENU" STYLE="display:none" > and it won't work with that. It's the javascript that actually shows the menu.

Another thing my <div> menu doesn't seem to be in a single container. Even when I did it the way you said to it only pertained to the first first div element. I only saw that that worked by taking out the STYLE="display:none"

Thanks for your help this has been bothering me for a while!!

PS: is there a way to put my whole div in one container?

johns311
04-11-2005, 04:30 AM
oPopup.onmouseout=oPopup.hide;

thanks glenngv. I tried that before and just did again, but I keep getting an error on page. I put that in the same function as where I created the popup. Is that what you would do?

function richDropDown(a,b,c,d,e,menu_name)
{
oPopup.document.body.innerHTML = menu_name.innerHTML;
oPopup.show(a,b,c,d,e);
oPopup.onmouseout=oPopup.hide;
}

glenngv
04-11-2005, 05:04 AM
What error message?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum