PDA

Click to See Complete Forum and Search --> : JavaScript, Checking Element Height.


gokujou
02-08-2007, 09:28 PM
I want to check the height of a div element in my html with javascript. I can not find the syntax to pull in data from html elements. I don't know if anyone here will know the answer but I will give it a shot.

Thank you for your help!

Ned
02-08-2007, 09:36 PM
I don't get it. Why do you need javascript to check the height of your div element? Why don't you just look in your stylesheet?

gokujou
02-08-2007, 09:48 PM
Well, I am doing animations in JavaScript. I need to know if it should expand or collapse.

I would use Flash where I know what I am doing, but this site needs to be fully compliant to standards and government accessibility.

EDIT: Got it, used a special tool and it lets me pull it out from a function.

tZ
02-08-2007, 11:10 PM
var el = document.getElementById('element');
alert(el.offsetHeight);

gokujou
02-10-2007, 01:41 PM
Ah, thank you!