473,320 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 11645
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: monika | last post by:
Hi all... I am able to select a student's story and open it in a word doc. the teacher then corrects the story, highlight in colors the comments, strikethrough. In fact all the privileges I...
9
by: Justin Koivisto | last post by:
Is there a way to create an alert-like message box that uses a custom image? Basically, I want to replace the default ! image with something else. -- Justin Koivisto - spam@koivi.com PHP...
2
by: D. Alvarado | last post by:
Hello, Just wanted to check if this was possible. I have n blocks of text and I would like each to pop up in a window. Hoever, I don't want to create n different HTML pages and invoke each one...
3
by: Craig | last post by:
First of all, this one is driving me crazy, so thanks in advance for any help!! I've got a javascript function in a parent document that generates an HTML document on the fly when a button is...
8
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it...
1
by: Mike R | last post by:
Whenever I try to change the html code below to produce the search results in a frame or new window it always does it always does it in the same window. I assume the problem is it must be...
4
by: darius | last post by:
Hello, I seem to be having trouble with a rather simple problem. I am opening a new window with the window.open command, and even though I set scrollbar=yes, I can't seem to get the window to...
19
by: Eva | last post by:
Hi, I'm really really really new to javascripts and so i couldn't really comprehend thoroughly on the the previous posts regarding this issue. Anyways, I'm setting up a picture album site....
2
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.