How can I fix the bootstrap navbar to the top after a div was scrolled?

后端 未结 4 912
遇见更好的自我
遇见更好的自我 2020-12-16 06:06

I am trying to get my navbar with bootstrap to appear after a certain div, called \"A\". Div \"a\" is at the top of by page, and has a height of around 400px. Once the user

4条回答
  •  攒了一身酷
    2020-12-16 06:12

    To get the effect show on facebook.com/home your navbar position should be set to static (or relative / absolute) until the user scrolls past 400px and then you need to set it's position to fixed so that is stays at the top of the screen. This can be done with a little javascript.

提交回复
热议问题