我有一个MCQ问题网站.在考试中,可能有来自不同科目的100-200个问题.所以我想让导航变得更容易.由于导航非常大,所以我想在开放主题下打开问题,即:当主题1处于活动状态时,只有主题1下的问题链接可见,如Bootstrap网站的右侧导航.我的工作样本如下.
I used Bootstrap scrollspy according to their site instruction and it
worked fine. But when I try to make it collapsible (like Bootstrap
website’s right navigation) it does not work.
我正在使用Bootstrap – 3.3.2
<body data-spy="scroll" data-target="#subjectNavbar" data-offset="0"> <header id="header" class="container-fluid navbar-fixed-top"> ... </header> <div class="container"> <div class="row"> <aside id="left-column" class="col-sm-3"> <nav id="subjectNavbar" class="sub-nav"> <ul class="nav subject-ul"> <li> <a href="#subject-1">Subject 1</a> <ul class="list-inline question-ul"> <li id="question-no-1"><a href="#question-1">1</a></li> <li id="question-no-2"><a href="#question-2">2</a></li> <li id="question-no-3"><a href="#question-3">3</a></li> ... <li id="question-no-20"><a href="#question-20">20</a></li> </ul> </li> <li> <a href="#subject-2">Subject 2</a> <ul class="list-inline question-ul"> <li id="question-no-21"><a href="#question-21">21</a></li> <li id="question-no-22"><a href="#question-22">22</a></li> <li id="question-no-23"><a href="#question-23">23</a></li> ... <li id="question-no-40"><a href="#question-40">40</a></li> </ul> </li> ... <li> <a href="#subject-5">Subject 5</a> <ul class="list-inline question-ul"> <li id="question-no-81"><a href="#question-81">81</a></li> <li id="question-no-82"><a href="#question-82">82</a></li> <li id="question-no-83"><a href="#question-83">83</a></li> ... <li id="question-no-100"><a href="#question-100">100</a></li> </ul> </li> </ul> </nav> </aside> <section class="col-sm-6"> <div class="question-paper"> <div class="subject-group" id="subject-1"> <h2>Subject 1</h2> <article id="question-1"> <header><em>1.</em> Question 1</header> <ol> <li>Option A</li> <li>Option B</li> <li>Option C</li> <li>Option D</li> </ol> </article> ... <article id="question-20"> <header><em>20.</em> Question 20</header> <ol> <li>Option A</li> <li>Option B</li> <li>Option C</li> <li>Option D</li> </ol> </article> </div> ... <div class="subject-group" id="subject-5"> <h2>Subject 5</h2> <article id="question-81"> <header><em>81.</em> Question 81</header> <ol> <li>Option A</li> <li>Option B</li> <li>Option C</li> <li>Option D</li> </ol> </article> ... <article id="question-100"> <header><em>100.</em> Question 100</header> <ol> <li>Option A</li> <li>Option B</li> <li>Option C</li> <li>Option D</li> </ol> </article> </div> </div> </section> <aside id="right-column" class="col-sm-3"> ... </aside> </div><!--/row--> </div><!--/.container--> <footer class="container"> ... </footer> </body>
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。