...

View Full Version : Help window.open FireFox vs I.E. (easy one)



mbl
10-31-2004, 05:52 AM
Good friends,

In the following code, a small text window opens when user clicks word BENEFITS. In Firefox, the child window opens on click just fine, and stays open so user can go back and do some adjustments that relate to the instructions in the child window (user needs to scroll up/down in parent window). In other words, the two windows are accessible independently. This is running on Windows XP machine.

However, the same code opened with the I.E., the child window opens and it is the ONLY one that can be accessed. So the user can not be reading the child-window instructions and access the parent window to scroll it for more info. Thus, in I.E., the child window HAS to be closed, defeating the purpose of it being an instructions window.

Here's the little code.
-----------------------------------------------
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
</HEAD>

<BODY>

<a href="javascript:void window.open
( 'camel_benefits.html',
'MyWin','width=300,height=500,
toolbar=0, top=150,
left=600, menubar=0, status=1,
scrollbars=0, resizable=1' )">
BENEFITS
</a>

</BODY>
</HTML>
------------------------------------

Is this a known deal? If so, what'd be a simple change
to achieve this simple thing and to behave as in I.E. the
same way (as described above) in Firefox?

Your kind help is appreciated.

Thanks.

-mbl-

jamescover
10-31-2004, 02:18 PM
:confused:

joh6nn
10-31-2004, 09:15 PM
can we see the page this is on?

mbl
10-31-2004, 09:44 PM
can we see the page this is on?

Yes. The page is: http://www.muga-zafu.com/camel.html

Opening it with FireFox, scroll the text-bar to Fig.3, browse over its text so the Fig.3 photo shows.

Then click BENEFITS which will open the child window (it's text). Move the child window anywhere to allow access to the parent window. Move the parent-window vertical-scroll bar so as to be able to see the photo complete. Then go back to the child-window 'BENEFITS' so both Parent and Child windows shows what needs to be seen. It works with the FireFox as shown.

However, when the same page opened with the I.E., the adjustments for proper viewing as explained above are NOT possible because with the I.E. the controls of the Parent window can not be accessed, meaning that the child-window "BENEFITS" has to be closed, missing the point of the user to see both windows.

Would say the difference seems to be important as far as browser-functioning, but would like to see if a simple fix is available. Am a beginner in this and would not like to re-do the page in any extenssive way.

Thanks.

-mbl-

joh6nn
11-01-2004, 02:01 AM
i'm pretty sure your problem is in camel_benefits.html, not in camel.html. you've got this in camel_benefits:


<body onblur="this.focus()"

that tells the browser to bring the window back to the top, whenever it loses focus. try removing that bit of code, and see if it helps.

mbl
11-01-2004, 04:12 AM
i'm pretty sure your problem is in camel_benefits.html, not in camel.html. you've got this in camel_benefits:


<body onblur="this.focus()"

that tells the browser to bring the window back to the top, whenever it loses focus. try removing that bit of code, and see if it helps.

Yes, friend.

That fixed it. Had put that code trying to keep the child window from getting lost behind the parent window and that did not work. Then changed the window to open much to the right with the LEFT parameter. Since in FireFox it made no difference, had overlooked to remove that onblur part.

Your expertise and kindness match each other.

Both appreciated.

-mbl-

mbl
11-01-2004, 04:34 AM
P.S.

Joj6nn, friends,

The correction is uploaded already. But do have this more to ask, if the answer is not too involved:

When the child window is opened (BENEFITS) and the user accesses the parent window, the child window at times may be completely covered by the parent window.

To most users, it may not be obvious that it is still behind the parent, though totally covered. So the user would again click on the word BENEFITS in the parent window and nothing happens. This would lead to confuse the user to think that something is not working.

Is there a way that if in this situation, clicking again on BENEFITS would bring the child window again to the fore-ground?

It's somewhat as if the word BENEFITS would first close the child window and then would open it again. In older programming languages, that's how it would be done.

But there may be newer ways. If so and not too involved, would appreciate some guideance there.

Thanks.

-mbl-

liorean
11-01-2004, 04:56 AM
Well, that should be simple. First, check if the BENEFITS window already exists. (do a simple type check) If it does and is not closed (read out the closed property), call focus on it. If it doesn't exist or is closed, open it.
function bringBenefitsToFocus(){
if(typeof windowobject=='undefined'||windowobject.closed)
windowobject=/* code to open the window here */;
else
windowobject.focus();
}

mbl
11-01-2004, 04:43 PM
Well, that should be simple. First, check if the BENEFITS window already exists. (do a simple type check) If it does and is not closed (read out the closed property), call focus on it. If it doesn't exist or is closed, open it.
function bringBenefitsToFocus(){
if(typeof windowobject=='undefined'||windowobject.closed)
windowobject=/* code to open the window here */;
else
windowobject.focus();
}


Thank you Lorian,

It looks just right. Will have to learn a bit about using function and will definitely try it.

Would like to point out also that functioning like the above code provides perhaps ought to be an intrinsic part of the window.open method. Why so?

Because window.open seems to do this:

1. Chcks for window to exist. If NOT, creates one.
2. Then opens it.
3. Then fills it.
4. THEN brings it to the foreground.

However,
1. Chcks for window to exist. If YES, DOES NOT create one.
2. Then opens it.
3. Then fills it (replacing existing data).
4. Then DOES NOT bring it to the foreground.

Would say that it does not make sense NOT TO bring it to the foreground only because of the criterium that it already exists.

Perhaps the window.open method ought to have a parameter to that effect.

Thanks a lot for the good help.

-mbl-



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum