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

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

Similar topics

23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
3
by: Bob | last post by:
I am trying to create a popup page (to act as a menu) from a parent page. When the parent page (index.jsp) calls my popup function (see below) it will properly open the correct size browser window...
13
by: ldan | last post by:
Hi everybody, I would not consider myself an expert in javascript - but so far whatever I know, helped me reaching my goals. Recently I started to experience a lot of javascript errors related...
6
by: VK | last post by:
I'm using window.open method in my script to open poup window. Recently Internet Explorer users reported that the script crashes on their machine with different runtime errors. See the bug:...
1
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
5
by: Nathan Sokalski | last post by:
How do I open and change properties of (such as size, position, scroll position, visibility of toolbars, etc.) a browser window? Thanks. -- Nathan Sokalski njsokalski@hotmail.com...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
0
by: GV | last post by:
Hi all, New to developing in VS 2005 ASP 2.0 Trying to have a easy pop calender for a button on a web page. I keep getting a error message in IE6 that says: Line 69 Char 3 Error:...
1
by: chris f | last post by:
Some of the cells in my ASP.NET 2 table have a popup that appears when the user hovers the mouse over a text area that is indicated using an anchor tag. The popup is implemented as a DIV tag...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.