I have a simple script that appends a class on scroll depth and would like to use it on my Wordpress site.
How should I go about adding it? I have the class pinpointed and know the CSS side, but I don't know how to get the script to register.
The script is:
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 100) {
$(".header").addClass("active");
} else {
$(".header").removeClass("active");
}
});