Click to See Complete Forum and Search --> : "onmouseout" the popup is suposed to close


andrew1234
07-01-2003, 01:40 AM
"onmoverover" a popup loads.

"onmouseout" the popup is suposed to close

but its leaveing the window open and closing the .htm file. how do i make it close both.?

I understand that i need to target the window but i'm not sure how?

thanks

Andrew


<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript">
var popupWin;
function fred(URL)
{
window.open(URL,"","height=260,width=380,resizable=0, left=100, top=100" );
}
function mark(URL)
{
if(popupWin!=null && !popupWin.closed){
popupWin.close();
}
}

</script>
</head>

<body>


<a onmouseover="javascript:fred('fred.htm')" onmouseout="javascript:mark('fred.htm')" >
<img src="hary.gif" name="Image31" width="142" height="55" border="0" id="Image31"></a>
</body>
</html>

JHL
07-01-2003, 02:21 AM
you need to set reference to the popup window.

change this line:

window.open(URL,"","height=260,width=380,resizable=0, left=100, top=100" );

to this:

popupWin = window.open(URL,"","height=260,width=380,resizable=0, left=100, top=100" );

andrew1234
07-01-2003, 03:21 AM
thanks for the help