Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

on scroll change navbar color

$(document).ready(function(){
    $(window).scroll(function(){
        if($(window).scrollTop() > $(window).height()){
            $(".menu").css({"background-color":"transparent"});   
        }
        else{
            $(".menu").css({"background-color":"white"});
        }

    })
})
Comment

javascript on scroll change nav color

$(function () {
  $(document).scroll(function () {
    var $nav = $(".navbar-fixed-top");
    $nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height());
  });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: on click jqueyr 
Javascript :: dynamic copyright year js 
Javascript :: javascript write text 
Javascript :: hello world using alert 
Javascript :: write to console using jQuery 
Javascript :: AWS S3 JavaScript example 
Javascript :: convert string to date using moment 
Javascript :: jspdf attach image file 
Javascript :: hide component on click vue 
Javascript :: order array of objects by id javascript 
Javascript :: target url javascript 
Javascript :: how to push at top of array 
Javascript :: sum of array elements in javascript 
Javascript :: how to move an element of an array in javascript 
Javascript :: Install react router in react app 
Javascript :: global error handling middleware express 
Javascript :: javascript get first 3 characters of string 
Javascript :: get date now javascript 
Javascript :: how to reverse number in javascript 
Javascript :: node js variables in string 
Javascript :: view background image in react native 
Javascript :: html javascript type 
Javascript :: javascript assign 
Javascript :: react-native-permissions could not be found within the project or in these directories: 
Javascript :: expressjs path optional parameters 
Javascript :: nodejs date difference 
Javascript :: express-generator 
Javascript :: pagination hook react 
Javascript :: this keyword in javascript medium 
Javascript :: Extract phone number from text regex 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =