Reading CSS height and width values ​​is Xpx in FF, while "auto" in IE

Div box sizes are measured using jQuery with the following code:

$(document).ready(function(){ var h = $("#testbox").css("height"); }); 

In FF, it gives me 270px, in IE auto. How can I measure the actual height / width of a div in IE without changing css?

+4
source share
2 answers

use .height () and .width ().

 var h = $("#testbox").height(); var w = $("#testbox").width(); 
+5
source

try to put css for # testbox

 #testbox { height: 0px; } 
+1
source

All Articles