PDA

View Full Version : Check height


Zynex
04-13-2007, 03:34 AM
Is there a script were you can say: If the height is greater 300, then display is none? I already tried:

if(wrapper.style.height > 300) {
wrapper.style.display = 'none';
}

I also placed an alert within the "if", but it just does not respond. The Id's and stuff are all ok. the path is also correct (wrapper.style) I already checked that.

Could someone help me??

kind regards,

Zynex

BonRouge
04-13-2007, 04:08 AM
Try 'scrollHeight' instead of 'style.height'.

Zynex
04-13-2007, 04:37 AM
That works fine thank you :). Kinda strange syntax in my opninio... why not just style.height :rolleyes: well whatever I didnt make it up haha :P
thanx again!

BonRouge
04-13-2007, 04:43 AM
'style' is the CSS style, shich has not been set. It will be undefined. 'scrollHeight' is the height you see whether or not it's been set in the CSS.