Change menu color when you scroll [closed]

I encounter the following problem, if anyone can help me. Can I change the color of the menu in the image when I scroll from black to white?


I would be very grateful.

Answer

You can do something like this : Working example

$(document).scroll(function() {
  var y = $(this).scrollTop();
  if (y > 800) {
    $('.className').fadeIn();
  } else {
    $('.className').fadeOut();
  }
});

Leave a Reply

Your email address will not be published. Required fields are marked *