I am trying to create a pop-up window that will remain in front of the
orignal webpage. The pop-up is called as follows:
<script type="text/javascript">
var newWin=null
var winl = (screen.width-208)/2;
var wint = (screen.height-228)/2;
newWin=window.open("URL",'mywindow','left=' + winl + ',top=' +
wint+
',width=208,height=228,toolbar=,menubar=,location=,scroll=,resizable=,status=');
newWin=window.focus(mywindow);
</script>
The webpage that this pop-up is called from is a completely blank page
that calls another website via a frame:
<frameset rows="100%,*">
<frame src="URL" >
<frame src="Untitled">
</frameset>
<noframes>
</noframes>
The reasoning behind this is because I am unable to modify the page
that the frame is calling and a pop-up needed to be loaded in front of
it. The problem is, when this page is run the pop-up comes into focus,
but when the frame called URL is finished loading, the pop-up is pushed
to the back. I cannot seem to find a way to make it focus and I think
that delaying the pop-up from lauching would solve this problem but I
have been unable to properly implement it.
If anyone can help me I would appreciate it.
-Thanks
David Given - 29 Jul 2005 17:40 GMT
[...]
> The problem is, when this page is run the pop-up comes into focus,
> but when the frame called URL is finished loading, the pop-up is pushed
> to the back. I cannot seem to find a way to make it focus and I think
> that delaying the pop-up from lauching would solve this problem but I
> have been unable to properly implement it.
Please don't try. Popups are incredibly antisocial, most people won't see
them, and reputable browsers won't *let* you do this kind of thing anyway.
You'd be much better off redesigning your web site not to need a popup.
What do you need it for, anyway? The only application I can think of for
what you want is advertising...
- --
+- David Given --McQ-+ "Information wants to be free, but my mail client
| dg@cowlark.com | does not want to be chock-full of herbal pot
| (dg@tao-group.com) | alternative spam." --- Sant Lupus on Slashdot
+- www.cowlark.com --+
Asterix2XXX - 29 Jul 2005 18:25 GMT
Actually, this code works in Firefox. Just not in IE. I'm pretty sure
those are reputable browsers.
I am aware of the antisocialness of pop-ups, but I have no way of
editing the page that is appearing in the frame being called, the page
is hosted by someone else, somewhere else.
But, i do need the pop-up to control this page. I just don't know how
to insert the timing control for the pop-up. And I promise that it is
not for an advertisment.
David Dorward - 30 Jul 2005 07:24 GMT
> var winl = (screen.width-208)/2;
> var wint = (screen.height-228)/2;
> newWin=window.open("URL",'mywindow','left=' + winl + ',top=' +
Popups sized or positioned based on the size of the "screen" are a bad idea.
That one, for example, will appear partially on one of my physical screens
and partially on another... with a three inch gap between the halves.

Signature
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is