Following is the code :
var b = this;
b.children("li").each(function() {
var c = jQuery(this).find("div:first");
var g = c.outerWidth();
alert(g);
}
the value that the alert statement throws up is a constant value ‘3’ for each iteration, though it should be different. Bug only in IE8. Reasons and any fix?
By default,
divtakes up the entire width of its parent element. So all div’s will have the same width:Example: http://jsfiddle.net/fwHe5/1/
Now, if you change that so that div’s float left and are relativly positioned, they no longer take up the entire width.
Example: http://jsfiddle.net/fwHe5/2/