...

View Full Version : how to get Screen position of HTML element in mozila ?



NatyN
09-04-2006, 08:26 AM
hi ,anyone know how can i get the screen coordiantes of an HtmlElement ?
i found this link :
http://www.mattkruse.com/javascript/anchorposition/source.html
it's not good for me b/c that i wanna get the screen position even if the browser is not open in the whole screen.

Thank u!

vwphillips
09-04-2006, 08:58 AM
// pass the HTML element return the x, y position
function zxcPos(zxcobj){
zxclft=zxcobj.offsetLeft;
zxctop=zxcobj.offsetTop;
while(zxcobj.offsetParent!=null){
zxcpar=zxcobj.offsetParent;
zxclft+=zxcpar.offsetLeft;
zxctop+=zxcpar.offsetTop;
zxcobj=zxcpar;
}
return [zxclft,zxctop];
}

NatyN
09-04-2006, 02:27 PM
thank u,
but your code return the coordinates of the elements in the document,
and i need the coordinate for the whole screen (for all the computer windows not inside the browser)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum