Hi, mindparasite-ga. Thank you for your question.
The window appears to be 'flashing' in Mac IE 5 because of the way the
browser decides when the mouse has left the link (so executing the
'onMouseout' event).
In most Mac browsers (namely, Chimera, Safari, OmniWeb, and the Mac OS
9 version of Internet Explorer) when the window loses focus (which
will happen when the browser opens the popup), the browser will not
execute any more Javascript code until the window regains the focus
(i.e, they either click in it to bring it to the front, or they close
the popup so the window is now frontmost). This is the reason it did
not disappear when you tested it in the Mac OS 9 version of Internet
Explorer 5 - it will not execute the code to close the popup until the
window is frontmost again.
In the OS X version of Internet Explorer, the browser will continue to
handle and run Javascript events, even when the window is not at the
front. The problem is that when the popup opens, the browser assumes
that the cursor has moved out of the window that opened it (even if it
hasn't). This means that the browser thinks that the cursor is no
longer over the link, either. As it's still running Javascript in the
window, it will do whatever it's supposed to do when the mouse leaves
the link... which is to close the popup. The window will then jump to
the front again, and it will think the mouse has entered the window
and the link again, so it'll open the popup, notice the mouse has
'left' the window, close the popup... and so on. This is why it seems
to flash.
The bad news is that there is no way to make it do exactly what you
want in any of the Mac browsers. This is a limitation of the operating
system, and there's not much anyone, aside from the developers, can do
about it.
You could solve the flashing problem to some extent by not
automatically closing the popup if the user is running the OS X
version of Internet Explorer. This would at least allow your visitors
to read it. This can be done by changing the code to detect the
specific browser with the problem:
<SCRIPT LANGUAGE="Javascript">
var popup_window = null;
function popup(status,url) {
if(status != 0) {
if(popup != null) popup.focus();
else {
var W = 290;
var H = 425;
var X = 1;
var Y = 1;
var winprefs =
"width="+W+",height="+H+",left="+X+",top="+Y+",screenX="+X+",screenY="+Y;
var popup = open(url, "Popup", winprefs);
window.focus;
popup_window = popup;
}
} else {
if (!(navigator.appName == "Microsoft Internet Explorer" &&
parseInt(navigator.appVersion)>=4 && navigator.platform == "MacPPC"))
{
if(popup_window != null) popup_window.close();
}
}
}
</SCRIPT>
Another solution would be to use completely different code to show the
information on the page.
http://www.dynamicdrive.com/dynamicindex5/index.html has several that
may be of use. If you simply wish to display some information when
they mouseover a link,
http://www.dynamicdrive.com/dynamicindex5/index.html may be useful -
and it works on all compliant browsers, IE for OS X included.
You may also find the following search of use:
'javascript window focus Mac IE'
(://www.google.com/search?q=javascript+window+focus+Mac+IE)
If you have any further queries about this, feel free to request a
clarification.
-- wildeeo |