The Function calculateWidth() fails in chrome
niklausburren opened this issue · comments
Niklaus Burren commented
By li elements without inner span the function outerWidth() returns in chrome the value NaN. So the calculation of the width fails. I inserted if statement to check if the li-elements conatins a span element:
this.calculateWidth = function() { var width = 0; for (var i = 0; i < $container.find("li").length; i++) { if ($container.find("li").eq(i).children("a").length) { width += $container.find("li").eq(i).children("a").eq(0).outerWidth(); } else { width += $container.find("li").eq(i).children("span").eq(0).outerWidth(); } } return width; }
Mohammad (Moa) Raji commented
Fixed with pull request #23.