In every browser, Win/Mac, Chrome, Safari, Firefox, Opera, IE6, and IE7 they ALL get the following console output:
352
254
But in IE8 I get:
414
434
454
474
Here is my JS/jQuery code:
$('#top-breadcrumbs').children('a').each(function(i){
if(!$(this).hasClass('permanent')){
if(permItemWidth+rmItemWidth > $('#top-breadcrumbs').width()){
$(this).addClass('removed');
rmItemWidth = rmItemWidth-$(this).width()+20;
}
}
});
The log code i have above is writing the NEW rmItemWidth value after its been reset in that 2nd if
I posted here, and then i finally figured it out playing with the code. So, the change? Well no actual code had to be changed haha IE8, actually, i think did it right… oddly enough:
Before:
After:
Because “this” is removed in that first line in the before, so technically, it would have no width. Thats why it was only adding 20 each time… is IE8 actually doing it correctly and no one else?!