Fair warning — I know little enough about javascript (as will soon become apparent).
I’ve been using a small piece of javascript code in a website I’m rebuilding. The code’s purpose is to pop up a small reference window that can pull from various html “anchors” in various files. It puts the focus on the newer, smaller window. If the user continues reading/scrolling through the main window, the focus disappears until the user does a mouseover on the next link, whereupon the original popup receives the focus and offers the new information.
The script works correctly in IE6, IE7, Opera 9.1. The glitch comes with Firefox 2.0. The first time a mouseover is done in Firefox, the window appears properly, and as long as the user mouses over the links (without returning focus to the main window) everything works fine. However, if the main window gets the focus, the smaller popup information window (while properly tracking the data) never reappears unless brought to the fore by the user manually.
The code looks like this:
<a href=”javascript: void(0)” onmouseover=”Features=window.open(‘filename.htm#databookmark’,’Features’,’scrollbars=yes,resizable=yes,width=200,height=350,screenX=50,screenY=250,left=50,top=250′); Features.focus()” >Desired Information Link.</a>
Obviously, either I’m missing something, or Firefox just handles this code differently from IE and Opera. Any suggestions or insights would be greatly appreciated.