Multiple Popup windows

  • Thread starter Willem van Isselmuden
  • Start date
W

Willem van Isselmuden

Hello,

I've a problem I hava a page with different popup windows,
when I hit a link the first one pops up and with the first open i would like
to hit the second link in the parent page so the second links pops up a
window in
the first popup. The way I have it now is working but with each link the
size
of the popup window should be different but that doesnt happen how can I
solve that problem?

this is my code:

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops =
'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',r
esizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


the first link:
<a href="#"
onClick="NewWindow('info_banketquiz.html','name','488','255');return
false;">info</a>


the second link:
<a href="#"
onClick="NewWindow('info_consumenten.html','name','488','405');return
false;">info</a>


I hope that somebody can help me

Greetings Willem
 
L

Lasse Reichstein Nielsen

Willem van Isselmuden said:
the first popup. The way I have it now is working but with each link
the size of the popup window should be different but that doesnt
happen
how can I solve that problem?
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;

It is safer not to position the new window. Positioning a window
realtive to the screen gives trouble for MDI browsers (like Opera) and
multi monitor setups. Letting the browser place the window will
most likely give an acceptable result for everybody.

Remember to make windows resizable and/or allow scrollbars. No matter
what you might think you are prepared for, there will always be some
person with a setup that makes the content overflow. (Me, e.g., as I
have a user stylesheet that adds content after links with a target
attribute, and a rule that locks the font-size of the body document to
100%).
the first link:
<a href="#"
onClick="NewWindow('info_banketquiz.html','name','488','255');return
false;">info</a>


the second link:
<a href="#"
onClick="NewWindow('info_consumenten.html','name','488','405');return
false;">info</a>

You open both windows with the same name (in fact the name "name").
That means that the second call to window.open will reuse the window,
and the configuration options are ignored.

You will either have to close the window and open it again, or just
resize it directly (with either the .resizeTo or the .resizeBy method).
Be aware that the resizeXX methods set the outer size of the window,
while the window.open configuration string sets the inner width and
height.
/L
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top