Twitter bootstrap 如何在模式中使用Bootstrap的Affix.js和Scrollspy?
我目前正在尝试修复一组内容左侧的导航。给你一个想法,我正在处理一对div中的col-md-3和col-md-6。简单地说:有两列,最小的一列包含导航链接列表nav nav pills nav stacked导航 问题是Scrollspy在单击并滚动到各自的部分后不会突出显示链接。而且,“粘贴”不会将导航栏固定到相邻柱的侧面 示例代码: index.html style.cssTwitter bootstrap 如何在模式中使用Bootstrap的Affix.js和Scrollspy?,twitter-bootstrap,twitter-bootstrap-3,affix,scrollspy,Twitter Bootstrap,Twitter Bootstrap 3,Affix,Scrollspy,我目前正在尝试修复一组内容左侧的导航。给你一个想法,我正在处理一对div中的col-md-3和col-md-6。简单地说:有两列,最小的一列包含导航链接列表nav nav pills nav stacked导航 问题是Scrollspy在单击并滚动到各自的部分后不会突出显示链接。而且,“粘贴”不会将导航栏固定到相邻柱的侧面 示例代码: index.html style.css 可能有用:modal中有选项卡,包括固定导航在内的这些部分应该位于一个选项卡中。您需要提供示例代码。@DavidG好的。
可能有用:modal中有选项卡,包括固定导航在内的这些部分应该位于一个选项卡中。您需要提供示例代码。@DavidG好的。就这么做了。希望对你有帮助。你可以把这个放在小提琴上。。。此外,您不希望同时使用词缀和scrollspy。。两个都可以吗?@nolawipetros我都想要。@Mr_Spock这在3中是不可能的,因为它们都使用相同的html attr data spy=stax data spy=scroll作为启动程序。。
<div class="container">
<div class="row">
<!-- My Naviagtion -->
<div class="col-md-3" data-spy="scroll" data-offset="0" data-target=".fun" role="complementary">
<div class="fun">
<ul class="nav nav-pills" role="tablist">
<li><h2>Navigation</h2></li>
<li><a href="#sectionone">Section1</li>
<li><a href="#sectiontwo">Section2</li>
</ul>
</div>
</div>
<div class="col-md-6" role="main">
<div id="#sectionone">...</div>
<div id="#sectiontwo">...</div>
</div>
</div> <!-- end row -->
</div> <!-- end container -->
$(document).ready(function() {
$('.col-md-3').scrollspy({ target: '.fun' });
}
.col-md-3 {
position: relative;
} /* At this point, I was trying anything. */