Answer the question
In order to leave comments, you need to log in
Why does the scroll script not work when transferring layout to modx?
On a laptop, with just layout with connected scripts, everything works.
//изменение цвета шапки при прокрутки
$(window).scroll(function() {
var heightwindow = $(window).height();
var scroll = $(window).scrollTop();
if (scroll >= heightwindow) {
$("nav.navbar").addClass("scrolled");
} else {
$("nav.navbar").removeClass("scrolled");
}
});
Answer the question
In order to leave comments, you need to log in
Well, have you checked the console?
Structure, has everything been added?
Js is exactly processed for scrolling (checked with the console)?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question