我一直在使用 Twitter Bootstrap Scrollspy 插件,但在我的一生中,我无法让它工作。这是内容区域的 HTML
<div data-spy="scroll" >
<section id="page_home" class="page_home" style="width:100%;background-color:rgb(245,245,245);">
<div class="container">
Home
</div>
</section>
<section id="page_projects" class="page_projects" style="width:100%;background-color:rgb(25,25,25);">
<div class="container">
Projects
</div>
</section>
<section id="page_services" class="page_services" style="width:100%;background-color:rgb(245,245,245);">
<div class="container">
Services
</div>
</section>
<section id="page_downloads" class="page_downloads" style="width:100%;background-color:rgb(25,25,25);">
<div class="container">
Downloads
</div>
</section>
<section id="page_about" class="page_about" style="width:100%;background-color:rgb(245,245,245);">
<div class="container">
About
</div>
</section>
<section id="page_contact" class="page_contact" style="width:100%;background-color:rgb(25,25,25);">
<div class="container">
Contact
</div>
</section>
</div>
这是导航栏的 HTML 代码
<div id="navbar" class="navbar navbar-inverse navbar-fixed-bottom">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li><a href="#page_home">Home</a></li>
<li><a href="#page_projects">Projects</a></li>
<li><a href="#page_services">Services</a></li>
<li><a href="#page_downloads">Downloads</a></li>
<li><a href="#page_about">About</a></li>
<li><a href="#page_contact">Contact</a></li>
</ul>
</div>
</div>
</div><!-- /.navbar -->
我看过其他一些帖子,但对于我的生活,我无法弄清楚为什么它只选择了导航栏中的最后一项。
谁能帮我弄清楚为什么scrollspy只选择最后一项以及如何纠正它?