Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

change header background color on scroll css

/* 
    .active { background-color: #fff}
*/
$(function() {
    $(window).on("scroll", function() {
        if($(window).scrollTop() > 50) {
            $(".header").addClass("active");
        } else {
           $(".header").removeClass("active");
        }
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: chart js laravel mix 
Javascript :: file name without extension javascript 
Javascript :: check jquery version on console 
Javascript :: array has object with property js 
Javascript :: react-native link to play store 
Javascript :: get uploaded file name in js 
Javascript :: javascript for each key in object 
Javascript :: angular cli add sslkey certificate 
Javascript :: find an object in an array of objects javascript 
Javascript :: jquery change value 
Javascript :: tab navigation react-native without title 
Javascript :: react app.js 
Javascript :: how to print two arrays side by side in javascript 
Javascript :: quotes api 
Javascript :: angular httpclient query params not working 
Javascript :: thinkful 
Javascript :: useHistory goback 
Javascript :: jquery Audio Play on button click 
Javascript :: filter special characters javascript 
Javascript :: network response timed out expo 
Javascript :: turn object to json javascript 
Javascript :: how select start from id in jquery 
Javascript :: hook access loopback 
Javascript :: Ready check failed: NOAUTH Authentication required. 
Javascript :: RFC 3339 format js 
Javascript :: javascript format number with commas 
Javascript :: Check if local storage is used or empty 
Javascript :: redirect link javascript 
Javascript :: replace node 
Javascript :: javascript download string as file 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =