简体   繁体   中英

Navbar fixed bottom position and switch to static when scroll location reached

Is this possible in Bootstrap v3? I've been searching and seems like I'll have to go custom.

Basically, I have a navbar which is located at the bottom of the content area. When the page is loaded, if the navbar code location is visible in the viewport then position should be static but if the page is longer and the code location is not visible then the position should be fixed bottom.

It's like the top navbars but for the bottom.

Sure, it's possible

1 Load bootstrap.js, bootstrap.css and jquery.js

2 Place the navbar at the end of the page

<div class=navbar data-spy="affix" data-offset-top="1">navbar</div>

3 Add a class into your page

.affix{bottom:0;}

That's it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM