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

how to get the window width/positions in asp.net web application

hi all,
I have a javascript to display popup window...

i need to dispaly that in the popup on button click and just beleow
the
button...

if i give some default coordinates for the popup, it works fine on the
resolution i set, but mislocates on the others locations..
is there any way to solve this problem... or is it possible to find the
screen cordinates.. so that i could locate the pop up just beleow the
button on all resolutions...

how can i solve this?
please reply as early as possible....

Charles

May 2 '06 #1
3 2821
you need to calc it.

function posY(obj){
var curtop = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
if (typeof(obj.scrollTop) == 'number')
curtop -= obj.scrollTop;
obj = obj.offsetParent;
}
}
else if (document.layers)
curtop += obj.y;
return curtop;
}

function posX = function(obj) {
var curleft = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (document.layers)
curleft += obj.x;
return curleft;
}
feel free to remove netscape 4 support.

-- bruce (sqlwork.com)
"Charleees" <vc********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
hi all,
I have a javascript to display popup window...

i need to dispaly that in the popup on button click and just beleow
the
button...

if i give some default coordinates for the popup, it works fine on the
resolution i set, but mislocates on the others locations..
is there any way to solve this problem... or is it possible to find the
screen cordinates.. so that i could locate the pop up just beleow the
button on all resolutions...

how can i solve this?
please reply as early as possible....

Charles

May 2 '06 #2


hi ,,

thanks mr.bruce..

can u plz tell me wat obj stands for..

thanks

Charles

bruce barker (sqlwork.com) skrev:
you need to calc it.

function posY(obj){
var curtop = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
if (typeof(obj.scrollTop) == 'number')
curtop -= obj.scrollTop;
obj = obj.offsetParent;
}
}
else if (document.layers)
curtop += obj.y;
return curtop;
}

function posX = function(obj) {
var curleft = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (document.layers)
curleft += obj.x;
return curleft;
}
feel free to remove netscape 4 support.

-- bruce (sqlwork.com)
"Charleees" <vc********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
hi all,
I have a javascript to display popup window...

i need to dispaly that in the popup on button click and just beleow
the
button...

if i give some default coordinates for the popup, it works fine on the
resolution i set, but mislocates on the others locations..
is there any way to solve this problem... or is it possible to find the
screen cordinates.. so that i could locate the pop up just beleow the
button on all resolutions...

how can i solve this?
please reply as early as possible....

Charles


May 3 '06 #3
It's the element that you want the position of.

I believe that bruce barker thought that it was so obvious that he
didn't even mention it...
Charleees wrote:

hi ,,

thanks mr.bruce..

can u plz tell me wat obj stands for..

thanks

Charles

bruce barker (sqlwork.com) skrev:
you need to calc it.

function posY(obj){
var curtop = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
if (typeof(obj.scrollTop) == 'number')
curtop -= obj.scrollTop;
obj = obj.offsetParent;
}
}
else if (document.layers)
curtop += obj.y;
return curtop;
}

function posX = function(obj) {
var curleft = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (document.layers)
curleft += obj.x;
return curleft;
}
feel free to remove netscape 4 support.

-- bruce (sqlwork.com)
"Charleees" <vc********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
hi all,
I have a javascript to display popup window...

i need to dispaly that in the popup on button click and just beleow
the
button...

if i give some default coordinates for the popup, it works fine on the
resolution i set, but mislocates on the others locations..
is there any way to solve this problem... or is it possible to find the
screen cordinates.. so that i could locate the pop up just beleow the
button on all resolutions...

how can i solve this?
please reply as early as possible....

Charles

May 3 '06 #4

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

Similar topics

1
by: SledgeHammer | last post by:
Hi group, Little question that bugs me .... I have a page (window) with frames. Topframe + MainFrame = page I want to close the whole window, but don't know how Can somebody help me with...
4
by: Anna Quick | last post by:
I am quite new to javascript, and don't seem to find the problem with stupid internet explorer. The script works fine in safari and mozilla. I searched the groups, but evidently put in the wrong...
4
by: Peter Kirk | last post by:
Hi, I want to open a popup-window which displays a list to the user. From this list, the user can select an item, and the data regarding this item is then transferred to some fields on the main...
3
by: anonieko | last post by:
You can try this code: > > > > > <!--- filename: mypage.html ----> <html> ....blah blah blah <script language=JavaScript src=/Javascript/center.js></script>
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
1
by: AMT2K5 | last post by:
Hello, I am just wondering if there is an easy way to do the following in my constructor IOScreen(int row, int col, int width, int height); sets the row, col, width, height attributes of the...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
2
by: KC | last post by:
Hi, Every JavaScript executive context has a top-level window and we can use window.open() to open another window ... Does this related to Windows created by click on "File"->"New Window" or...
3
by: simora | last post by:
Hi: Need some working sample code to post hidden form data from a php page to a new popup window. 540 x 500 centered. The popup that I'm calling already is formatted and has a TITLE:web-2007.php...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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.