javascript Twitter引导崩溃不起任何作用

h9a6wy2h  于 2022-11-20  发布在  Java
关注(0)|答案(1)|浏览(119)

我试着使用twitter bootstrap网站上提供的例子来实现collapse。当我试用这段代码时,点击链接来折叠内容并没有什么效果。下面是我的代码:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Test</title>

    <link href="../css/bootstrap.css" rel="stylesheet">
    <link href="../css/bootstrap-responsive.css" rel="stylesheet">
    <script type="text/javascript" src="../js/bootstrap.js"></script>

</head>
<body>

<div class="accordion" id="accordion2">
    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                Collapsible Group Item #1
            </a>
        </div>
        <div id="collapseOne" class="accordion-body collapse in">
            <div class="accordion-inner">
                Anim pariatur cliche...
            </div>
        </div>
    </div>
    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
                Collapsible Group Item #2
            </a>
        </div>
        <div id="collapseTwo" class="accordion-body collapse">
            <div class="accordion-inner">
                Anim pariatur cliche...
            </div>
        </div>
    </div>
</div>

</body>
</html>
6ie5vjzr

6ie5vjzr1#

Bootstrap的JavaScript库依赖于jQuery。

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="../js/bootstrap.js"></script>

请在此处查看备注-http://getbootstrap.com/2.3.2/getting-started.html#file-structure
请注意,所有JavaScript插件都要求包含jQuery。
或者现代版的~ http://getbootstrap.com/getting-started/#jquery-required

需要jQuery

请注意,所有JavaScript插件都要求包含jQuery,如启动模板. Consult our bower.json中所示,以查看支持哪些版本的jQuery。

相关问题