Click to See Complete Forum and Search --> : element height


anarchist
06-18-2003, 07:15 AM
I need to find the height of an element on my page so I can position an image at the bottom

element.height gives undefined
and element.style.height give me a blank even though the height is set with the stylesheet, its currently a known value but I plan to set it to 100% so will need to know the actual value

is there anyway to do this simply?

crs
06-18-2003, 07:19 AM
element.innerHeight

anarchist
06-18-2003, 07:22 AM
thanks but no luck, thats undefined

if I set the height with height= in the tag would that help rather thean using my stylesheet?

anarchist
06-18-2003, 07:29 AM
thinking along the lines of innerHeight I tried scroll height, which gave me half the size of the element:confused: but I brought up interdevs help and that had a see also of offsetHeight which works fine now:)

crs
06-18-2003, 07:31 AM
Ups...

I meant offsetHeight and misstyped with innerHeight.

Sorry

anarchist
06-18-2003, 07:56 AM
chears

didnt realise it was an ie only property when I tested it, we're not supporting netscape at the minute so not a problem, would be nice if all the browsers supported everything, rather than us having to write twice as much code at least to get things to work