0

How can I make this more smooth?

$(window).bind('scroll', function () {
    if ($(window).scrollTop() > 80) {
        $('.menu').addClass('fixed');
    } else {
        $('.menu').removeClass('fixed');
    }
});

I would like an effect, where .menu gets filled with a color starting from the top.

I tried with css3 styling.

.fixed {
   position: fixed;
   background-color: #fff;
   width: 100%;
   transition: all .5s ease-in;
   box-shadow: 0px 2px 10px 0px #424242;
}
Jed Fox
  • 2,979
  • 5
  • 28
  • 38
Homme
  • 23
  • 8

0 Answers0