Marty.H Marty.H - 1 year ago 100
jQuery Question

What can cause height() to return as a negative value?

This is my code to see the height of an element:

console.log($(".divText").height()); // Returns negative value
console.log($(".divText").outerHeight()); // returns zero

I have the code execute on a click event, the page displays the element, I am selecting the correct element and there are no floats involved. What else can cause this to happen?

Answer Source

Put that code inside

    //your code
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download