Twitter引导程序选项卡在IE8中不起作用 [英] Twitter Bootstrap tabs not working in IE8

查看:148
本文介绍了Twitter引导程序选项卡在IE8中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在IE8中使用代码直接在Twitter Bootstrap的示例页面上使用代码,但它们的行为方式与它们在示例页面上的行为方式不同。

I'm trying to get tabs working in IE8, using code directly off the examples page for Twitter Bootstrap, but they just aren't behaving the same way as they do on the example page.

具体来说,非活动标签始终可见。

Specifically, the inactive tabs always remain visible.

以下代码:

<head>
    <link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet" media="screen">
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://twitter.github.io/bootstrap/assets/js/bootstrap.min.js"></script>
</head>

<ul class="nav nav-tabs" id="myTab">
  <li class="active"><a href="#home">Home</a></li>
  <li><a href="#profile">Profile</a></li>
  <li><a href="#messages">Messages</a></li>
  <li><a href="#settings">Settings</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="home">1...</div>
  <div class="tab-pane" id="profile">2...</div>
  <div class="tab-pane" id="messages">3...</div>
  <div class="tab-pane" id="settings">4...</div>
</div>

<script>
    $(function () {
        $('#myTab a').click(function (e) {
            e.preventDefault();
            $(this).tab('show');
        });
    });
</script>

我尝试使用数据切换标签并使用建议的.tab来启动标签页()方法但没有区别......非活动标签总是可见的!

I've tried initiating the tabs both through using data-toggle tags and also using the suggested .tab() method but no difference... the inactive tabs are always visible!

JSfiddle链接在这里(但是jsfiddle在IE8中无效): http://jsfiddle.net/4gNpt/

JSfiddle link here (but jsfiddle doesn't work in IE8 anyway): http://jsfiddle.net/4gNpt/

已解决! - 看来html文件的第一行必须是

SOLVED! - It appears that the first line of the html file must be

<!DOCTYPE html>

否则它根本无法正常工作。

Otherwise it doesn't work properly at all.

推荐答案

解决了! - 看来html文件的第一行必须是

Solved! - It appears that the first line of the html file must be

<!DOCTYPE html>

否则它根本无法正常工作。

Otherwise it doesn't work properly at all.

这篇关于Twitter引导程序选项卡在IE8中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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