Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Javascript - detect the position of the browser window

Posted on 2009-05-09
2
Medium Priority
?
235 Views
Last Modified: 2012-05-06
I'm trying to get a new browser window to appear in front of the current page the user is looking at.  I know how to create the new window and how to detect the width and height of the current browser window.  But I need to be able to check the browsers position on the computer screens.

The way I have it configured now, it appears a certain distance from the top-left of the screen.  This however could pose a problem with different sized computer screens and especially when a user has dual monitors.

Is there any way to detect the browsers postion so that I can position my new window relative to the old?
0
Comment
Question by:josephdaviskcrm
2 Comments
 
LVL 5

Accepted Solution

by:
satheeshm earned 2000 total points
ID: 24349142
Hi,

You can use Screen.height and Screen.Width to find the screen height and window.

Follow the below link to make you window center on the screen, irrespective of different screen sizes.

http://www.boutell.com/newfaq/creating/windowcenter.html

Thanks,
Satheesh M
0
 

Author Comment

by:josephdaviskcrm
ID: 24391149
This doesn't seem to be what I'm looking for.  Is there javascript that can tell me the distance from the top or from the left the current window is?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question