Why can not work $(window).scroll(function(){});?

On the website the script doesn't work when scrolling the website.
$(window).scroll(function() {
 var headerHeight = $('.header').outerHeight();
 if ($(this).scrollTop() > headerHeight && $('.navigate').hasClass('navigate--loading')) {
$('.navigate').removeClass('navigate--loading').addClass('navigate--scrolling');
 } else if ($(this).scrollTop() <= headerHeight && $('.navigate').hasClass('navigate--scrolling')) {
$('.navigate').removeClass('navigate--scrolling').addClass('navigate--loading');
}
});


Tried just
$(window).scroll(function() {
alert(1);
});


Still not working.

Removed all scripts, not helping, conflict like no.
And damn, the console does not see the problem.

Nothing best personal Finance doesn't work.
June 10th 19 at 15:14
1 answer
June 10th 19 at 15:16
Solution
Solve the problem with what You Skalite. According to the resource on the first link - You have 2 scroll
Wow, EPT. - caleb_Stehr commented on June 10th 19 at 15:19
Damn, I spent 2 hours looking for the problem in the script, but I stupidly didn't know the extra scrolling((( - caleb_Stehr commented on June 10th 19 at 15:22
and that means extra scrolling? - gustave_Kertzmann52 commented on June 10th 19 at 15:25
I already fixed, there were 2 scrolling on html and body. - caleb_Stehr commented on June 10th 19 at 15:28
in the sense of two handlers? - gustave_Kertzmann52 commented on June 10th 19 at 15:31
not just two scroll bars) In the result window and spun so as cool only the body. Somehow it was.
html { owerflow-y: scroll; }
body { owerflow-y: scroll; }
- caleb_Stehr commented on June 10th 19 at 15:34
and, of course, thank you. - gustave_Kertzmann52 commented on June 10th 19 at 15:37

Find more questions by tags jQueryJavaScriptLayout