Hi Jason,
rav4ski wrote:I am not sure whether this is a browser (javascript) or it's an issue of the menu.
I think it's probably a combination of browser differences, plus what you're trying to do.
Please check the following,
http://www.cojava.com/jsMenu/popup/menu.htm You can mouse over to the menu item "Test - Opened in New window". Click on each one of them and see what happened? I tested them in IE6.0, it will resize if the popup window is closed.
The menu code uses the js method called window.open() to open a new window. If the named window (passed in the menu's
target property) is not open already, the function opens a new one with the specified name and specified properties (passed in the menu's
targetfeatures property). If the specified window is already open, then the window,open() method will load the specified url, but will not change the window properties. In other words, once the window is open, it remains open where it is and how big it is; the window.open() method does not resize or reposition a window (there are other js methods of the window object for doing those things: window.resizeTo(), window.resizeBy(), window.moveTo(), window.moveBy(), etc. ). So, the upshot is that this observation:
...it will resize if the popup window is closed.
is the expected behavior.
For the NS 7.1, it pops up different size of window than IE. Also, the NS 7.1 just can't take any size feature correctly. The size of popups are all wrong. For the FireFox PR 1.0, it just crashes the browser all the time.
I'm going to guess that at least part of the problem is that some of the targetfeatures you've used are not supported by all of the browsers that you mention. For example, I see that you use
left= and
top= in the targetfeatures, but as far as I know, these are IE4+ features and are not supported in NS7.1. I also notice that you pass
resize=1 as well as
resizable=1, but as far as I know, there is no window attribute called
resize (the property is
resizable). So, it could be that the presence of unsupported or unrecognized window properties in your targetfeatures string is causing the browser to choke.
Is it a fully tested feature?
I would have to guess that it's as fully tested as any feature can be across browsers.
How can it be so complicated for a popup?
Well... as you can see from the above discussion, it can be complicated, especially across browsers. This is probably why some of the window attributes you've tried to use are not mentioned in
sample11. The ones lited in the sample may be the only ones that can be relied upon to behave consistently across different browsers.
Or I should just other javascript to open the target?
This isn't a bad idea (it's how I would do it, if that matters). WIth your own function wrapping the capabilities of the window.open() method, you can have finer control over what happens, including specifying different behaviors for different browsers. If you do a search in the v5 Help Forum for 'targetfeatures' you will find more discussion about these issues, as well as examples of functions you can use to open windows yourself. You also might find
this list of window attributes that are available to window.open() useful.
Hope that helps,
Kevin