Fading bootstrap navbar on scrolldown, while changing text color

前端 未结 3 941
闹比i
闹比i 2021-02-11 08:18

so I\'m working on a Ruby on Rails app with a design given to me which calls for the navigation bar to be transparent at the top of the page, and then fade into solid white afte

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-11 09:02

    This is great. For newbies, for the opaque class, I did the following:

    .navbar-default {
      min-height: 120px;
      opacity: 0;
      transition: opacity .5s;
    }
    .opaque {
      opacity: 1;
      transition: opacity .5s;
    }

    Change the fade time under the transition attribute. This doesn't work for all browsers but it looks great for now.

提交回复
热议问题