View Full Version : Getting an object position to set a window.open position
04-13-2005, 02:49 PM
Hi Dudes, i'm experiencing some problems to manage this...
i managed to get the object position through a div( or span)
now what i want is to set the position of the window.open, like..
i got a image(object) with known position, now i want to open below this object the window.open(a small window popup)
ps : the resolution of the user doesnt matter. always have to appear below the object.
if i failed making myself clear, ask me for more info about the problem.
now i want to open below this object the window.open
You can not open a new window below an opener's object...
04-13-2005, 05:24 PM
what i want is when the window.open is executed, the opened window opens right there.. below the object ...
what i have is a field with an image in its rightside , and when i click this image it opens a popup window with a calendar, but i want this calendar to be open below the field and the userīs resolution shouldnt be a problem.
i can open the popup window if i know the userīs resolution, i could set a function that would verify that, and depending on its value the function could calculate where to put the popup window. but i want something that i shouldnt care for userīs interface... the popup window should be always there... just below the field that receives the DATE
aha.I got it.
To get the real absolute postion of an object (your field), you may use this short code:
var x;var y
Now you can open the pop-up according to the values x and y. You don't need to know the user's monitor resolution.
Note. If you have tables, and the align of them is set by "center" HTML attribute, maybe it would be safer to build it in a full mode, at least with <tbody>
as Mozilla might rather consider the tbody's position as parent that the "unknown" table's position.
04-14-2005, 12:31 PM
this code u passed me Kor, would work in this case:
imaging the default userīs resolution as 1024x768
but when he opens the database( i work with Lotus Notes) through a web browser( the application im doing is for web) , it will open as 1024x768.. but if the user "Restore down", change the resolutionīs value. will the calendar open below the field anyway?
i want to set this calendar below the DATE field in all userīs choices of how he uses his IE or NS ( talking about on Resize window event)
i will test your code . thanks.
I don't quite get it...
change the resolutionīs value
Why user should change the resolution during the sesion? As a web designer I do that quite often to verify a page on different resolutions, and this bothers me enough... Why should a simple user change it's resolution? And, anyway... The resolution has nothing to do with the object's position. Nomatter the resolution, an object is placed at the same number of pixels left/top starting from the left/top 0 corner of the page
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.