我想创建一个左边粘性栏菜单与bootstrap 3喜欢:
http://getbootstrap.com/getting-started/
我会阅读给定的文档http://getbootstrap.com/javascript/#affix
我尝试用.affix但结果是零。
更新:@Skelly,
感谢您的实例。是的,我想要你的例子。我会下载你的示例html,但下载后html文件的侧栏没有工作。
解决方法
这里是一个工作左边栏例子:
http://bootply.com/90936(类似于Bootstrap文档)
诀窍是使用affix组件和一些CSS来定位它:
- #sidebar.affix-top {
- position: static;
- margin-top:30px;
- width:228px;
- }
- #sidebar.affix {
- position: fixed;
- top:70px;
- width:228px;
- }