469,929 Members | 1,797 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

open a popup in a desired position

Hi,
I have a picturegallery that opens in a new window as a defined size,
but I would like to open the popup in the middle of the screen. Some
browsers do it like that, others don't... Any ideas how I can define the
position for the windows to open in?

Jul 20 '05 #1
4 6943
Use this in your new window

<SCRIPT Language="JavaScript">
<!--
self.window.moveTo(0,0); //or let JavaScript calculate the middle
position...that's up to you...
//-->
</SCRIPT>
"@(none)" <""fredu\"@(none)"> schreef in bericht
news:3f********@newsflash.abo.fi...
Hi,
I have a picturegallery that opens in a new window as a defined size,
but I would like to open the popup in the middle of the screen. Some
browsers do it like that, others don't... Any ideas how I can define the
position for the windows to open in?

Jul 20 '05 #2
"@(none)" wrote on 13/11/2003:
Hi,
I have a picturegallery that opens in a new window as a defined size, but I would like to open the popup in the middle of the screen. Some
browsers do it like that, others don't... Any ideas how I can define the position for the windows to open in?


Though you can do this with window.moveTo(), there are some things you
should consider. Please read "Hi, stupid popup question", posted
originally 13:14 on 2003/11/12. Richard Cornford and I have a debate
about positioning windows. Ignore my comments: read his.

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)
Jul 20 '05 #3
DU
none wrote:
Hi,
I have a picturegallery that opens in a new window as a defined size,
but I would like to open the popup in the middle of the screen. Some
browsers do it like that, others don't... Any ideas how I can define the
position for the windows to open in?

Here's my recommendation. Make your secondary window resizable, with
scrollbars if needed (that is if content overflows requested window
dimensions) and with presence of statusbar. Don't try to position the
window; let the user do that. OTOH, make your requested popup re-usable
so that only and only 1 popup will be used to view all your picture
gallery images. Usability studies have shown that users don't like to
manage multiple windows, browser application instances at the same time.

If images are of different sizes, then you can still make your *script*
open only 1 popup at a time; if the user wants to open all the images in
distinct popups, then your page coding should allow that. Finally I
assure you that there are a few usability issues which are much more
important to deal with than position of popups and which often irritates
users or which make users leave sites using requestd popups: these are
main issues which are usually not taken into consideration.

DU

Jul 20 '05 #4
none wrote:
I have a picturegallery that opens in a new window as a defined size,
but I would like to open the popup in the middle of the screen. Some
browsers do it like that, others don't... Any ideas how I can define the
position for the windows to open in?


You never know the center of the screen, so stop wasting time to think about
it. All you can do is trust the visitor that his UA has client-side script
support and has it enabled, that he will not leave the site when you display
the resource-consuming popup and that he accepts popups where they are shown
by his UA (think about built-in fuzzy-logic positioning, browser tabs and
stuff like that.)
PointedEars
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by Markus | last post: by
13 posts views Thread by ldan | last post: by
5 posts views Thread by Nathan Sokalski | last post: by
18 posts views Thread by Colin McGuire | last post: by
reply views Thread by GV | last post: by
1 post views Thread by chris f | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.