<script type="text/javascript">
function winopen(e,linkid)
{
if(document.all)
{
leftpos=event.screenX;
toppos=event.screenY;
}
if(document.layers||document.getElementById)
{
leftpos=e.screenX;
toppos=e.screenY;
}
toppos=toppos+10
MessageWin=eval('window.open(linkid,"newwin",config="width=200,height=100,location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resiza ble=no,top='+toppos+',left='+leftpos+'")');
MessageWin.focus()
}
</script>
<a href="#" onMouseOver="winopen(event,'Default2.aspx')" önMouseOut="MessageWin.close()">Open Window</a>
here is my code to open a new window on mouse over and close the windows when mouse out. it working fine at google chrome, but have 1 small problem with IE with windows 7.
if the new windows open at the center of my mouse cursor, the browser read it as 'onMouseOut', so what happend here is the new windows keep open and close. how to solve this?
=================================================================
Added
var time;
function chkFocus(){
time = setTimeout(function(){
if(MessageWin.onfocus){
}
else{
MessageWin.close();
}
}, 100);
and set my onmouseover="chkFocus()";
well, problem still the same, i believe we almost solve the problem. i put timeout as '100' because i want it to be closed instantely when mouseout.