twitter 引导标签:内容窗格中的链接不起作用 [英] twitter bootstrap tabs: links in content-panes not working

查看:43
本文介绍了twitter 引导标签:内容窗格中的链接不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一个工作标签实例并准备了一个 jsfiddle(不知何故标签在这里无法正常工作,但链接问题仍然存在):http://jsfiddle.net/Gyrga/6/

选项卡窗格中的链接不再起作用,也不会转到 URL http://somewhere.com .. 为什么?我忽略了什么?

谢谢!

解决方案

在使用标签页时,需要进行以下操作(根据文档)

<div class="tab-pane active" id="home">...</div><!-- 等等-->

但在您的示例中,您将 data-toggle="tab" 放在 .tab-pane 上,这会破坏内部的链接.

只需删除此属性并将其放在实际切换选项卡的链接上即可.这样你甚至不需要 JavaScript 来激活它们.

工作演示(jsfiddle)

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!

解决方案

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)

这篇关于twitter 引导标签:内容窗格中的链接不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆