Forum Moderators: open
Was hoping someone might know if you can fix the position of a popup on the screen.
I want the popup window(s) to open at fixed points so 2 will align down the length of the screen, not overlap, and will always position themselves exactly. EG X 100 : Y 100
Is there a scrap of code I can add to simple popup javascript to action this?
Many thanks
Limbo
Try something like this;
thiswindow=window.open([usual stuff]);
thiswindow.moveTo((screen.width-widthis)/2,(screen.height-heightis)/2);
Use the moveTo to change the position, I use this to center the window.
You can use this to open the first window then again to open the second, but change the second moveTo function to take into account the first windows width and height, i.e.
thiswindow1.moveTo(x1,y1)
thiswindow2.moveTo((x1+window1width),(y1+window1height))
Works exactly as I imagined
Tedster >> The window positioning portions of the features string for window.open are not standardized. While Explorer uses left= and top= (as in the above code) Netscape uses screenX= and screenY=.
Is this what you meant? ;
<script>
function openpopup(){
winpops=window.open("http://www.google.com","","fullscreen=no,toolbar=yes,status=yes,
menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes,
width=500,height=400,left=100,top=100,screenX=100,screenY=100")
}
</script>
Ta
Limbo
I was hoping that I could use popupwindows to create a '4 window mosiac' that would work well for a page <toolbox?> we are experimenting with.
I was hoping the javascript for each window would open paralell to oneanother but it seems the lower javascript call is overiding the others above it.
Can anybody help, please. script below
<script>
function openpopup(){
winpops=window.open("http://www.google.com","","fullscreen=no,toolbar=no,status=no,
menubar=no,scrollbars=no,resizable=no,width=100,height=100,left=100,top=100,screenX=100,screenY=100")
}
</script>
<a href="javascript: openpopup()" title="click to open POPUP">FIXED WINDOW POSITION
POPUP1</a>
<script>
function openpopup(){
winpops=window.open("http://www.google.com","","fullscreen=no,toolbar=no,status=no,
menubar=no,scrollbars=no,resizable=no,width=100,height=100,left=200,top=100,screenX=200,screenY=100")
}
</script>
<a href="javascript: openpopup()" title="click to open POPUP">FIXED WINDOW POSITION
POPUP2</a>
Ta
Liam