Answer the question
In order to leave comments, you need to log in
Scroll question?
Hello everyone, how can I track the scroll of a page 300px from its start using js / jquery?
The code below didn't work.
$("body").ready(function($){
var height = "300px";
if ($("body").scrollTop >= height ({
$("body").addClass("MyClass");
} else {
$("body").removeClass("MyClass");
});
});
Answer the question
In order to leave comments, you need to log in
https://api.jquery.com/scroll/
With the help of this event (I guess)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question