why IE reset focus behaves different then firerfox

J

john_woo

Hi,

I want to make a pop up windows always on top, the following code
works well in firefox (tested in 3.5 and 3.6), but for IE (tested in
IE 8 and IE 7), it doesn't:

<html>
<head>
<script language="javascript" type="text/javascript">
function openN() {
popwin = window.open('http://
www.google.com','newWindow','height=500,width=700');
popwin.focus();
window.onfocus = function () {
if (popwin != null) {
popwin.focus();
}
}
}
</script>
</head>
<body>
<input type="button" value="open" onclick="openN();"/>
<p>
<input type="button" value="disable by pop up" onclick="alert
('enable');"/>
</body>
</html>

FYI: I've tried using document.onfocusin (for IE) still got same
result.

Can any one explain/fix something?

Thanks
 
S

Scott Sauyet

J

john_woo

I want to make a pop up windows always on top, the following code
works well in firefox (tested in 3.5 and 3.6), but for IE (tested in
IE 8 and IE 7), it doesn't: [ ... ]
    popwin = window.open('http://www.google.com','newWindow','height=500,width=700');

I know that FF implemented IE's showModalWindow, but I don't know if
others have:

    popwin = window.showModalDialog('http://www.google.com',
                {}, 'dialogheight:500; dialogwidth:700');

Good luck,

  -- Scott

Thank you, Scoot.

BTW, how could I know what functions (ex: window.showModalDialog)
implemented in IE only?
 
S

Scott Sauyet

R

RobG

Hi,

I want to make a pop up windows always on top, the following code
works well in firefox (tested in 3.5 and 3.6), but for IE (tested in
IE 8 and IE 7), it doesn't: [...]
Can any one explain/fix something?

Don't attempt it. It is a very annoying UI feature so browsers like
Firefox allow users to set preferences to stop script raising,
lowering, moving or resizing windows.
 
W

wilq

Hi,

I want to make a pop up windows always on top, the following code
works well in firefox (tested in 3.5 and 3.6), but for IE (tested in
IE 8 and IE 7), it doesn't:

<html>
<head>
<script language="javascript" type="text/javascript">
function openN() {
        popwin = window.open('http://www.google.com','newWindow','height=500,width=700');
        popwin.focus();
        window.onfocus = function () {
                if (popwin != null) {
                        popwin.focus();
                }
        }}

</script>
</head>
<body>
<input type="button" value="open" onclick="openN();"/>
<p>
<input type="button" value="disable by pop up" onclick="alert
('enable');"/>
</body>
</html>

FYI: I've tried using document.onfocusin (for IE) still got same
result.

Can any one explain/fix something?

Thanks


Maybe its not exactly what you need, but you can do an overlay that
hides everything on original window and have an information that a
modal window was open and you cant interract with this one.... This
way you wont block browser window, maybe even add a button there to
focus on modal window again? Just an idea..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top