How do you use headroom.js with Bootstrap 3 navbar?

前端 未结 4 1394
难免孤独
难免孤独 2021-01-31 20:20

I found this JavaScript widget http://wicky.nillia.ms/headroom.js/ and I want to use it in a web application using Bootstrap 3. It doesn\'t seem to be working. Any suggestion o

4条回答
  •  别那么骄傲
    2021-01-31 21:23

    The styles in the accepted answer aren't required to get headroom.js to work w/ Twitter Bootstrap 3. Simply following the instructions will work with navbar-fixed-top. The main thing is that you assign styles to these classes, otherwise nothing appears to happen.

    .headroom--pinned {
        display: block;
    }
    .headroom--unpinned {
        display: none;
    }
    

提交回复
热议问题