...

View Full Version : element position in firefox from top of screen



crazygamer
09-22-2005, 02:13 AM
I've been trying to get the x,y coordinates of an element from the top of the viewing area. So far I've tried looping through the parents of the element and getting their "offsetTop" and adding all of those together. However, this always gives me the same number no matter where my element is.

Does anyone know a sure way to get the position of an element in firefox?

Thanks.

rm-f
09-22-2005, 03:03 PM
DOM Inspector Ctrl+Shift+I

position of the FF window on the screen:
HTMLDocument.defaultView.screenX



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum