473,404 Members | 2,213 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,404 software developers and data experts.

popups relative to resolution?

Hi,
Does anyone know where I can get a script for a pop-up where I can
control fixed positioning of a popup based on browser resolution?

two res's: 800 x 600 and 1024 x 768

Thanks in advance

Lee
Jul 20 '05 #1
2 1850
"Lee Mundie" <le**********@ntlworld.com> writes:
Does anyone know where I can get a script for a pop-up where I can
control fixed positioning of a popup based on browser resolution?

two res's: 800 x 600 and 1024 x 768


Those are screen resolutions, not browser resolutions. My browser
typically takes up ~900x1000 on a 1600x1200 screen. Since it is an MDI
client, new popups cannot be larger than the visible area of the
browser viewport (~900x900) and cannot be placed outside those bounds
either.

So, don't use screen resolution, it's not relevant to the task. And be very
careful when positioning new windows, since there are several cases where
your attempts fail badly.

With that being said, you position new windows created with
window.open using the third argument. Example:

var win = window.open("someURL.html","windowName",
"width=400,height=300,top=100,left=120,resizable=y es");

Making the position depend on screen resolution (bad choice!) would be:

---
var left=120,top=100;
if (screen.width == 800) {
left = 300;
top = 200;
} else if (screen.width == 1024) {
left = 500;
top = 300;
}
var win = window.open("someURL.html","windowName",
"width=400,height=300," +
"top=" + top + ",left=" + left + ",resizable=yes");
---

You can read more here:
<URL:http://www.infimum.dk/HTML/JSwindows.html#ref_3_2>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Lee Mundie hu kiteb:
Hi,
Does anyone know where I can get a script for a pop-up where I can
control fixed positioning of a popup based on browser resolution?

two res's: 800 x 600 and 1024 x 768


What about where the browser is not maximised?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Buck Turgidson | last post by:
I am trying to learn PHP. I am confused as to why I need $_SERVER in the first block, but just $PHP_SELF in the 2nd. I don't see the latter assigned anywhere in the code. Thanks for any...
52
by: Harlan Messinger | last post by:
Can you help me figure out what to do about popups? Sometimes we develop web applications where popups make very good sense for precisely the same reasons they make sense in traditional...
7
by: Bob Wightman | last post by:
I've had a look through the archives but cannot find anything that really answers this so... I have a menu system composed of a series of "buttons" (actually span elements) that react to the...
2
by: Tom Szabo | last post by:
Hi, >>IE in Windows XP Service Pack 2 has a popup blocker that blocks unsolicited >>popups >>IE (other than Windows XP Service Pack 2) also has many add-ons (Google toolbar, >>Yahoo! toolbar,...
2
by: Rob R. Ainscough | last post by:
I'm slowly (very slowly) working my way thru the bizarre and sadistic world of control positioning in MultiViews (ASP 2.0). I came across this to help me explain (or attempt to anyway) why my web...
6
by: Steve Brecher | last post by:
Well, they are puzzles for me, anyway! On a linux/Apache shared host, a working web site has this directory structure (for clarity, each directory name ends with "D"): webD -- the FTP root...
3
by: Raffi | last post by:
Hello, I've been struggling and trying to work around this for a while and have even posted on usenet in the past without any working solutions. I'm posting it again in case someone out there...
6
by: howa | last post by:
Hi, In Yahoo YUI Grid CSS, It specified the relative width of a container (e.g. 750px) by, e.g. width : 57.6293em; /* 750 div 13 */ *width : 56.25em; /* 750 div 13.3333 for IE */ 1. Is...
1
by: Moe Sisko | last post by:
Using : ASP.NET 2.0, IE 7. This is a strange problem with popups not working in IE to remote sites, even though popups are allowed in IE. To reproduce, create web site with two pages,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.