this code is working in Firefox but not in Chrome v.23. When I trace the code in debugger everything works fine but Chrome doesn't change class. Any ideas?
$(document).scroll(function () {
$('a.nav').each(function () {
var divTop = $('#' + this.title).offset().top;
var distance = divTop - $("html").scrollTop();
if (distance > 210 && distance < 255) {
$('a.active').removeClass('active');
$(this).addClass('active');
}
});
});