Tim Marshall Tim Marshall - 2 years ago 193
Javascript Question

JQuery .height() returning 0

Live: http://rafflebananza.com/Admin/Desktop/index123.html#

I am trying to use JQuery to obtain the height for the amount of administrators under the users section of the quick side bar you see to the right.

var temp = $('.Admins').height();

The above what should be working script, regardless of if I enclose within document ready or window load, always returns the value of 0 and not the height.

Answer Source

It's because of the float style in the child elements. Try adding this code to clear the float:

.Group.Admins::after {
    content: '';
    clear: both;
    display: block;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download