var itemsWidth = 0;
$('li').each(function (el) {
var width = $(this).width();
itemsWidth += width;
});
IE will return a value of 'auto' for the width unless it is explicitly set in CSS. This is a bit of a problem when you are running over items that you don't know the content of and need to set the parent object's width dynamically.
In IE7 and 8, if I run something like this:
IE will return a value of 'auto' for the width unless it is explicitly set in CSS. This is a bit of a problem when you are running over items that you don't know the content of and need to set the parent object's width dynamically.