Friday, 25 September 2015

How do I find the height of a div?

I have a div with an ID of menu whose height is set to auto in CSS. The height of the div can change as the size of the window changes, and I need to find the exact height of #menu in order to make the page more responsive and to avoid overflow of elements directly under it.

I have tried $("#menu").height();, but it only returns the word null, indicating that it couldn't get the div height.

What might be causing jQuery .height to return null? Is there another way of finding it?



Epic visual tool

Epson 5030UB 2D/3D 1080p 3LCD Projector Submitted September 26, 2015 at 06:31AM by FlirtyBirdy01 http://ift.tt/1Woy5WA

No comments:

Post a Comment