change nav color on scroll vanilla js

Solutions on MaxInterview for change nav color on scroll vanilla js by the best coders in the world

showing results for - "change nav color on scroll vanilla js"
Lolita
18 Aug 2016
1$(function () {
2  $(document).scroll(function () {
3    var $nav = $(".navbar-fixed-top");
4    $nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height());
5  });
6});
Matteo
11 Jul 2019
1var myNav = document.getElementById("nav");
2
3window.onscroll = function() {
4  "use strict";
5  if (document.body.scrollTop >= 280 || document.documentElement.scrollTop >= 280) {
6    myNav.classList.add("scroll");
7  } else {
8    myNav.classList.remove("scroll");
9  }
10};
Cristina
07 Jun 2018
1if (document.body.scrollTop >= 280 || document.documentElement.scrollTop >= 280) {
2
queries leading to this page
how to change background color of navbar on scrollhow to change onscroll navbar color change using html and csson scroll navbar change color of svg logo on every section csssticky bar changs color when scroll in bootstrapnavbar window change functinchange color when scroll downchange nav style according to scroll view vanilla jschange background color of navbar on scroll to divnavbar on scroll change colorhow to change the color of navbar while scrolling at certain positionsto change color of navigation bar while scrolling using csshow to make your navbar change color when scrollstyle changed after navbar fixed propertyadd elements to nav bar on scroll only csschange menu color on scrollchange nav bar color on scrollchange navitem background color on scroll positionchanging the background color of a navbar on scroll jsnavbar color only when scroll downhow to change navbar color on scroll htmlsticky nav bar background color change on scrollset a navbar to a color when the scroll startshow to activate a navbar after scrolling downchange color of top scrollable nav depending on the screen coloronscroll navbar color changeon scroll navbar background color change in bootstrapwhen scroll change color navbarbootstrap 4 navbar scroll fixed top and colorbootstrap scroll top navbar color changejs event listener scroll down navbarchange color navbar on scrollnavbar change background color on scroll javascriptchange background color of navbar on scrollnavigation bar change color on scroll change navbar after scroll javascxirptcustom scroll on navbar color changechange nav background color on scroll jsbootstrap change navbar color scrollhow to change navbar background color on scroll bootstrapbackground color navbar on scrollscroll navigatio change colorchange navbar color on scroll jschanging color of navbar on scrollchange scroll bar color csschange navigation bar color on scrollchange navbar color on scrolltop javascriptchange color of nav on scrollfixed nav change colorhtml nav bar change color on scrollhow to change nav bar color on scrolling tcsscss navigation scroll down diffrent backgroud colorhow to change color of navbar while scrollinghow to change color of static header in bootstraphow to change color style for on scroll navbar in css how to change the color of navbar on scrollchange color of navbar on scrollchange navbar style on scrollnavbar sticky color changenavbar scroll change colornavbar change color on scroll csstoggle navbar color on scrollchange navbar color when on scroll javascriptchange navbar color and elements on scroll changing navbar color on scrollanimate navbar color on scrollnavbar color change on scrollchange color of nav bar on scrollnavbar background on scrollhow to change navbar color when scrolladd color on nav on scrollcode to mkae navigation bar transparent and than turn it to white on scrolllcss change scrollbar colorchange nav background color on scroll javascripton scroll javascript change background colorchange nav color on scroll in pure jschnage the colour of nav bar on scrollbootstrap change on scrolljquery bootstrap nav mouse scroll color changescroll event change color of navbari want my navbar to change color when i scroll downchange nav background color on scroll css vanillaon scroll add color nav 27navbar color change on scroll jshow to make navbar change color on scrollchange navbar color on scroll with scrolltop javascriptscrollbar appears only when mouse scroll using jquery codepenchange navbar text color on scroll detect by background colorscroll change background color nav javascriptnav change a color when scroll how to add a background to a nav bar when start scrollingnavbar color not changing on scrollnavbar color change on scroll htmlhow to change navbar color on scroll javascriptscroll event change color of navbar on jscss scroll condition for nav barwindow on scroll change navbar coloronscroll change navbar coloron scroll change nav background colornavbar color change bootstrap jquery on scrollchange navbar color on scroll bootstrap no jquerynavbar window change functionchange navbar color on scroll bootstraphow to change nav color on scroonscroll navbar color change bootstrap 5 vanilla jschange nav color when scrollhow to toggle navigation bar color using javascript when a perticular amount of page is scrollednavbar change background color on scroll javascript add classbootstrap navbar color change on scrollbootstrap navbar change collor on scrollhow to s chnage navbar color on scroll i jschange nav colour on scrollchange nav color when scrolingsticky navbar change color jsturn bootstrap navbar black on scrollchange navbar color when on topbootstrap 4 logo with navbar scroll up backgroundjs change nav color on scrollcss on scroll top bar fix and coor changeon scroll apply style to nav itemusing javscript window scroll y to change navbar bg colorchange nav color on scroll javascriptchange nav bar color on scrollhtml on scroll change navbar colorchange nav colour jquery how to make navbar change as you scrollhow to change the color of navbar on scroll in jschange nav color on scroll vanilla jschange navbar color on scroll bootstrap 4jquery code for selecting id class and change nav coloro on scrollnavigation change a color when scroll javascriptnav bar change color on scrollchange nav background color on scroll cssjavascript for nav bar color 26 title color after scrolling will changenavbar scrolling change colorjavascript on scroll change navigation background colorhow to change navbar color on scroll with keyframeschange navbar after scrolling javascriptchange color of navbar on scroll javascriptnavigation bar change color on scroll bootstrapmenu bar change color after scroll downbootstrap css navbar scroll backgroudon scroll navbar background color changehow to give background color to fixed navbar in bootstrapchange navbar color when on scrollwebsite change navbar colorchange nav color on scroll htmlwindow scroll event navbarnavbar change background color on scrollbootstrap change nav color on scrollchange nav background color on scroll css without bootstrapchange nav colour when it hits footerchange color on scroll csschange scrollbar colornavbar sticky color chane in scrollcss change color after scrollonscroll nav color changechange navbar based on scrollcolor change when nav scrollbootstrap navbar change color on scroll change color scroll navbarchange navbar color on scroll bootstrap 5change navbark dark class to navbar light on scrollsticky navbar that changes color on scrollchange navbar background on scroll in htmlchange nav color on scroll csscss change color when scrollhow to change nav bar color on scrolling the pagewhen we scroll down change navbar color in javascriptchange background color navbar on scroll javascripthow to change color of navbar on scrollmouse wheel control change nav bootstraphow to change img in navbar after some heighton scroll the navbar color should change in cssnavbar change color on scrollon scroll navbar color changebuutstrap navbar change color on scrollchange navigation color after scrollingchange navbar color on scroll javascripton scroll change navbar colorshow background header bar on scrollnavbar change color when scrollnav change color on scrollchange navbar color on scroll cssjquery change color back to top depend backgroundnavbar scroll color changechange navbar color on scrollhow to change color of nav on scrolljavascript change navbar color on scrollhow to change navbar position when scroll bootstrapjs to change nav menu colors on scrollchange color of nav menu dropdown webflowcss chaning nav color on scrollif scroll is greater than 50px change colour javascriptchange navbar style on scroll to another sectionbootstrap nav change color on scrollchange navbar text color on scroll jsdarken navbar on scroll csshow to make nav bar backround color on scrolljs if topbar scroll change colorhow to change nav bar color on scrolling cssnave bar color chnag eon scrollnavbar change color on scroll using csschange nav color on scrollon scroll change navbar color csschange the navbar from scrolling downnavbar section color css scrollcss change navbar color on scrollas scroll change nav colornavbar on scroll add color javascriptcss js change nav color on scrollchange nav style according to scroll viewchange navbar background color on scrolljs navbar scroll colornavbar on scroll add colorchange navbar color onscrollnavbar turn to other color when scrollchange background color on scroll navigationchange navbar class on scroll bootstrapcode when sroll change colormake navbar change color on scrollscroll then nav bar change colornav color change on scrollwhen we use scroll down nav bar background color change in bootstrapnavbar color change on scroll javascriptcss onscroll bootstrap menu colorjs if bootstrap topbar scroll change colorchange color on scroll navbarjavascript change navbar color on scroll downon scroll nav bar background color change using javascriptjavascript for nav bar 26 title color after scrolling will changechange the background of navbar on scroll cssnavbar bg only after scrollingnavbar color change after scrolljs cange background of navbar on scrollnavigation menu background color on scroll csshow to change navbar font color through javascript on scrollset a color to a navbar when start scrollingscroll then navbar change colorwhen start scrolling the nav changesnavbar change color after 100vhchange color of navbar when scrollhtml change color of navbar on scrollchange navbar background on scrollslider change color on scroll bootstrap 4how to make the navbar change color on scrollchange navbar color when scrollonscroll navbar color change in bootstrapjavascript change navbar on scrollsticky navbar change color on scroll using cssbootstrap change navbar after scrollnavbar changes the color when starts movinghow to change navbar color in onscrollnavbar change on scroll bootstrapchange navbar windowchange navbar color scrollchange the color of the transparent when scroll to white background html csshow to change navbar background color on scrollchange navbar color on scroll vanilla javascriptchange navbar to fixed when scrolling downnavbar changing on scrollhow to change navbar color on scrollcss navbar change color on scrollcss navbar colour change on scrolltop navbar using javascript that change color on scrollhow to change navbar top on scrollcss js change nav color color on scrollnav change color javascriptscroll navbar change color using js make navbar transition color change when scroll downmenubar color change on scrollscroll element background color changehow to change color of nav bar item on scroll 2fhow to change navbar color when scroll in jschange navbar background color on scroll jquerynav change a color when scroll jsjavascript on scroll change nav colorchange nav color on scroll vanilla js