Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-18-2002, 02:07 AM   PM User | #1
cunning-fox
New Coder

 
Join Date: Jun 2002
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
cunning-fox is an unknown quantity at this point
center the window horizontally and vertically

Hi,

Is there anything you can add to this code to make the window centered horizontally and vertically. Here is the code:

<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>


<a href="#" onClick="MM_openBrWindow(page.html,'','scrollbars=no,width=551,height=324,directories=no,menubar=no, resizable=yes,left=121,top=100')">Click Here</a>

Last edited by cunning-fox; 06-18-2002 at 02:25 AM..
cunning-fox is offline   Reply With Quote
Old 06-18-2002, 02:56 AM   PM User | #2
x_goose_x
Regular Coder

 
Join Date: Jun 2002
Location: Montreal, Canada
Posts: 644
Thanks: 0
Thanked 0 Times in 0 Posts
x_goose_x is an unknown quantity at this point
Didn't test it, because pop ups don't work on my pc, but I think it should work and here it is.

<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
pop = window.open(theURL,winName,features);
if (document.layers) {
xoff = (screen.availWidth-pop.window.outerwidth)/2;
yoff = (screen.availHeight-pop.window.outerheight)/2;
}else if (document.all) {
xoff = (screen.width-pop.document.body.scrollWidth)/2;
yoff = (screen.height-pop.document.body.scrollHeight)/2;
}
pop.moveTo(xoff,yoff);
}
//-->
</script>
x_goose_x is offline   Reply With Quote
Old 06-18-2002, 05:30 AM   PM User | #3
eak
Regular Coder

 
eak's Avatar
 
Join Date: Jun 2002
Location: Nashville, TN
Posts: 354
Thanks: 0
Thanked 26 Times in 26 Posts
eak is on a distinguished road
Thumbs up

go to my NewWindow script generator to get the javascript that will do exactly what you want.
__________________
eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."
eak is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:55 PM.


Advertisement
Log in to turn off these ads.