views:

152

answers:

2

Div box dimensions are measured using jQuery with following code:

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

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

+3  A: 

use .height() and .width().

var h = $("#testbox").height();
var w = $("#testbox").width();
redsquare
Simple like that!
Andrejs Cainikovs
+1  A: 

try putting the css for # testbox

#testbox {
   height: 0px; 
}
andres descalzo
No.One of the question parts was: How can I measure actual div height/width in IE without changing it's css?
Andrejs Cainikovs