Answers for "jquery scoll to add class"

1

onscroll add class jquery

$(window).scroll(function() {    
    var scroll = $(window).scrollTop();
    if (scroll >= 500) {
        $(".clearHeader").addClass("darkHeader");
    }
});
Posted by: Guest on August-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language