Answers for "on scroll add class jquery"

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