我正在使用 foundation 5 vertical tabs .它工作正常,但单击选项卡会将 id 添加到 URL。
<dl class="tabs vertical" data-tab>
<dd class="active"><a href="#panel1">Tab 1</a></dd>
<dd><a href="#panel2">Tab 2</a></dd>
<dd><a href="#panel3">Tab 3</a></dd>
</dl>
<div class="tabs-content">
<div class="content active" id="panel1">
<p>tab1</p>
</div>
<div class="content" id="panel2">
<p>tab2.</p>
</div>
<div class="content" id="panel3">
<p>tab3.</p>
</div>
</div>
http://localhost:3000/#panel1
http://localhost:3000/#panel2
http://localhost:3000/#panel3
我不希望 href 出现在 URL 中。我可以通过任何选项来避免该 URL 吗?
编辑:在foundation tab page他们展示了一堆标签示例,在他们的示例中, anchor 没有添加到 URL,因此必须有一个选项来避免它,这在文档中没有提到。
最佳答案
不,没有...您正在使用 id 的 anchor 作为它应该瞄准的地方的符号。
关于javascript - 如何避免基础垂直标签网址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27293972/