views:

91

answers:

1

Hi all

I have a question regarding how to get a div height. I'm aware of .height() and innerHeight(), but none of them does the job for me in this case. The thing is that in this case I have a div that is overflown width a overflow: scroll and the div has a fixed height.

If I use .height() or innerHeight(), both of them gives me the height of the visible area, but if I want the overflown taken in to account, how do I go about?

+4  A: 

Use the .scrollHeight property of the DOM node: $('#your_div')[0].scrollHeight

reko_t
Thanks, but that gives me zero.var scrollareaHeight = $('#overview_holder')[0].scrollHeightalert(scrollareaHeight);You know why?
emilolsson
Ok, it works now.. Thanks for the help.!
emilolsson
@emilolsson - Please accept this answer if it helped you out by clicking the checkmark to the left, this gives you rep, the answerer rep and makes your questions more appealing to answer in the future :)
Nick Craver
Yes Nick, I will! Getting use to the functionality here on Stack Overflow. Thanks for letting me know. ;)
emilolsson