Find X,Y position of a element
-
Hi, How to find the Find X,Y position of a element, which is working both in IE and Firefox. Codes from net not working in mozilla. Thankyou
-
Hi, How to find the Find X,Y position of a element, which is working both in IE and Firefox. Codes from net not working in mozilla. Thankyou
use property .style (CSS) complete HTML and DHTML reference for IE see http://msdn.microsoft.com/en-us/library/ms533050.aspx .position see http://msdn.microsoft.com/en-us/library/ms531140.aspx
-
Hi, How to find the Find X,Y position of a element, which is working both in IE and Firefox. Codes from net not working in mozilla. Thankyou
Try this:
var e = document.getElementById(id), x = e.offsetLeft, y = e.offsetTop;
while(e = e.offsetParent) {
x += e.offsetLeft;
y += e.offsetTop;
}