[英]Navbar fixed bottom position and switch to static when scroll location reached
Is this possible in Bootstrap v3? 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 1加载bootstrap.js,bootstrap.css和jquery.js
2 Place the navbar at the end of the page 2将导航栏放在页面的末尾
<div class=navbar data-spy="affix" data-offset-top="1">navbar</div>
3 Add a class into your page 3在您的页面中添加一个类
.affix{bottom:0;}
That's it. 而已。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.