0

I have pages with "tabs" - if you open everything they are very long, but when tabs is activated the page is a lot shorter.

Now I need to accurately calculate the height of the wrapper div (which encloses all these elements) but it reports the value when everything is visible therefore resulting in false values..

George Katsanos
  • 13,524
  • 16
  • 62
  • 98
  • 1
    Don't calculate the height until the divs are hidden. Why don't you post some code then we might have a chance of helping. – Turnip May 07 '13 at 13:38
  • check this out: http://stackoverflow.com/questions/1473584/need-to-find-height-of-hidden-div-on-page-set-to-displaynone – Seer May 07 '13 at 15:01

1 Answers1

2

If your element has display:none in css, the browser doesn't bother rendering it at all. In this case, the answer is not directly. In recent jQueries, you can't even get its width or height.

You can get coordinates of visibility:hidden element but display:none element is excluded from rendering tree. So its position is undefined.

benka
  • 4,732
  • 35
  • 47
  • 58
Archydemon
  • 21
  • 3