Topic: navbar color not changing on scroll

Santosh Kumar free asked 1 year ago


$(window).scroll(function(){ $('nav').toggleClass('scrolled', $(this).scrollTop() > 1080); });

.fixed-top.scrolled { background:#fff !important; } hello i am using this code to change my nav color while scroll but it is not working kindly help me


Marcin Luczak staff commented 1 year ago

Hi,

Please create a snippet with your whole code of the navbar. Without the context, it will be difficult to find what is wrong.

Keep coding,

Marcin



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: system
  • Browser: google chrome
  • OS: intel duel core
  • Provided sample code: No
  • Provided link: No