views:

50

answers:

1

Hi, I am writing a chrome extension and from the content script I want to calculate the absolute position of a DOM element. But from within content script, if i try to access offsetHeight, offsetWidth, offsetTop, offsetParent, etc, I get null. I guess content scripts don't have access to those DOM properties.

Is there a way/workaround, i can find those properties?

A: 

It should work great, how are you accessing it?

// Should be something like this:
var height = document.getElementById('mydiv').offsetHeight;

https://developer.mozilla.org/En/DOM/Element.offsetHeight

Mohamed Mansour
actually chorme does not understand embed that well. :( ..embed.offsetHeight is null but it gives me embed.height. So i kind of had to work around .. created a div on top of the embed and calculate the position of that div.Worked.Thanks for the help.
Ashish