问题
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