Home › Forums › JavaScript › window scroll javascript error › Re: window scroll javascript error
May 13, 2013 at 2:49 pm
#134957
sabas
Member
ah ok! but still getting the same error with that stripped down code. a thing that i notice though is that if i just keep 2 instances of the if ($(this).scrollTop() >= $('article[data-anchor="2013"]').offset().top) {
$('.navigation-timeline a').removeClass('active');
$('.navigation-timeline a:eq(0)').addClass('active');
the error disappears but if i had another one. it comes back again! so the scroll event is fired many times. is there anyway to prevent that?