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

  • Thread starter Thread starter Charleees
  • Start date Start date
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
 
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)
 
hi ,,

thanks mr.bruce..

can u plz tell me wat obj stands for..

thanks

Charles



bruce barker (sqlwork.com) skrev:
 
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...
 
Back
Top