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

C

Charleees

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
 
B

bruce barker \(sqlwork.com\)

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)
 
C

Charleees

hi ,,

thanks mr.bruce..

can u plz tell me wat obj stands for..

thanks

Charles



bruce barker (sqlwork.com) skrev:
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top