offsetWidth - problem

M

mero123

Hi,

I have got the question according to reading width of an element using
offsetWidth property.

........ document.getElementById("ElementId").offsetWidth .......

Above expression works properly on Firefox (returns requested value)
but IE gives "0" value. I really don't know why. Simetimes when i open
a new IE window it works but after F5 or opening another new window i
have got "0" again. Why?? Thanks for help....
 
V

VK

Hi,

I have got the question according to reading width of an element using
offsetWidth property.

........ document.getElementById("ElementId").offsetWidth .......

Above expression works properly on Firefox (returns requested value)
but IE gives "0" value. I really don't know why. Simetimes when i open
a new IE window it works but after F5 or opening another new window i
have got "0" again. Why?? Thanks for help....

you are not trying to read the value before window.onload is
triggered, are you? Normally an attempt to use DOM interfaces before
page "load" event works as you described: 50/50, depending on weather
conditions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top