Click to See Complete Forum and Search --> : Onmouseover test if the popup is open.


andrew1234
07-01-2003, 03:27 AM
Hi my second question today is

Onmouseover the popup opens.
Onmouseout the popup stays.

how do i make it that if the pop is already open
Onmouseover won't open that popup again until its been closed

the script below keeps opening two windows

thanks

Andrew



<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript">
var popupwin;


function fred(URL) {


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

if (popupwin==false){
popupwin;
}

}

</script>
</head>

<body>


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

JHL
07-01-2003, 03:35 AM
change your function to this:

function fred(URL) {
if (popupwin==null || popupwin.closed)
popupwin= window.open(URL,"","height=260,width=380,resizable=0, left=100, top=100") ;
}

andrew1234
07-01-2003, 03:42 AM
thanks

you rule

Andrew