当前位置 : 主页 > 网页制作 > Bootstarp >

Bootstrap折叠不使用JQuery

来源:互联网 收集:自由互联 发布时间:2021-06-12
这让我疯了. 我有这个: div class="container" div class="panel panel-primary" div class="panel-heading" id="panel-head" a data-toggle="collapse" data-target="#collapseDiv" class="white-link" id="toggle" Records Added span class="in
这让我疯了.

我有这个:

<div class="container">
        <div class="panel panel-primary">
            <div class="panel-heading" id="panel-head">


                <a data-toggle="collapse" data-target="#collapseDiv" class="white-link" id="toggle" >Records Added
                    <span class="indicator glyphicon glyphicon-chevron-down pull-left pad-right" id ="glyphicon"></span>
                </a>

            </div>


            <div id="collapseDiv" class="panel-collapse collapse">
                <div class="panel-body">

而我正试图用这种方式解决崩溃问题(以各种方式):

$( ‘#collapseDiv’).崩溃( “切换”)

我得到的只是:

Uncaught TypeError: $(…).collapse is not a function(…)

有任何想法吗?

“`

“`

确保Jquery包含在Bootstrap之上,它工作正常

$('#collapseDiv').collapse("toggle");
.white-link{color:#fff;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<script src="http://img.558idc.com/uploadfile/allimg/210612/11335221B-1.jpg"></script>

<div class="container">
  <div class="panel panel-primary">
    <div class="panel-heading" id="panel-head">


      <a data-toggle="collapse" data-target="#collapseDiv" class="white-link" id="toggle">Records Added
                        <span class="indicator glyphicon glyphicon-chevron-down pull-left pad-right" id ="glyphicon"></span>
                    </a>

    </div>


    <div id="collapseDiv" class="panel-collapse collapse">
      <div class="panel-body">
上一篇:用于symfony2的Bootstrap3 Bundle
下一篇:没有了
网友评论