twitter bootstrap tabs: links in content-panes not working

大城市里の小女人 提交于 2019-12-24 02:15:13

问题


i have a working tabs instance here and prepared a jsfiddle (somehow the tabs don't work correctly here, but the link issue is still present): http://jsfiddle.net/Gyrga/6/

The links in the tab panes don't work anymore and don't go to the URL http://somewhere.com at all.. Why? What did I overlook?

Thanks!


回答1:


When you use the tabs, you need to do the following (according to the doc)

<a href="#home" data-toggle="tab">Home</a>
<!-- etc -->
<div class="tab-content">
    <div class="tab-pane active" id="home">...</div>
    <!-- etc -->
</div>

But in your example, you put the data-toggle="tab" on the .tab-pane which breaks the links inside.

Just remove this attribute and put it on the link which actually toggles the tab. That way you won't even need the JavaScript to activate them.

Working demo (jsfiddle)



来源:https://stackoverflow.com/questions/11955861/twitter-bootstrap-tabs-links-in-content-panes-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!