469,282 Members | 1,715 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

window.open - align right?


Hi,

I'm using window.open to open a pop-up and I'm aware of the top and
left parameters. Is there any way of opening a pop-up completely right
justified/aligned?

Thanks,
Vinod.

Sep 15 '05 #1
6 11197
FantaJ said the following on 9/15/2005 6:10 AM:
Hi,

I'm using window.open to open a pop-up and I'm aware of the top and
left parameters. Is there any way of opening a pop-up completely right
justified/aligned?


No.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 15 '05 #2
Randy Webb <Hi************@aol.com> wrote:
No.


Why not? The size of the window and the screen can be known, so there
is at least a good chance that the window can be right-aligned, isn't
there?

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Sep 15 '05 #3
FantaJ <vi*********@gmail.com> wrote:
I'm using window.open to open a pop-up and I'm aware of the top and
left parameters. Is there any way of opening a pop-up completely right
justified/aligned?


Try the following:

function popup( width, height, url ) {
var left=screen.width-width;
var top=screen.height-height;
var pWin=open( url, 'win', 'width='+width+',height='+height+',left='+left+',t op='+top );
if( pWin.screenX != null ) {
pWin.screenX=left;
pWin.screenY=top;
}
}

You will end up with a window that is at least approximately in the
lower right corner of the screen, with variations depending on the
exact browser used. This may or may not be acceptable for your
purposes; it's something to work from. Notice, in any case, that it
works reasonably in Firefox and IE.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Sep 15 '05 #4
Christopher Benson-Manica said the following on 9/15/2005 2:38 PM:
Randy Webb <Hi************@aol.com> wrote:

No.

Why not?


Because you can not do it.

The size of the window and the screen can be known,
That is not all you need to know though.

You need to know, at minimum, the following:

1) Width of the monitor the browser window is in.
2) Width of any chrome elements on the browser window. It differs for
different browsers.
3) Any taskbar/launchbars that may/may not be on the right hand side of
the monitor.

screen.width for me at the moment is 2560px, but, you can not place a
window with it's right side at 2560. My configuration at the moment does
not allow it.
so there is at least a good chance that the window can be
right-aligned, isn't there?


No.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 15 '05 #5
thanks for the replys guys...

Sep 16 '05 #6
FantaJ said the following on 9/16/2005 12:57 PM:
thanks for the replys guys...


Thanks for your quoting what you are replying to, as addressed in the
group FAQ that the URL to is in my signature.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 16 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Justin Koivisto | last post: by
2 posts views Thread by D. Alvarado | last post: by
3 posts views Thread by Craig | last post: by
1 post views Thread by Mike R | last post: by
4 posts views Thread by darius | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.