如何在bootstrap collapse插件上禁用bootstrap默认行为

时间:2013-08-23 01:48:28

标签: javascript css twitter-bootstrap

所以我看的是:

  • 当您单击可折叠对象的标题时,则不会发生任何事情
  • $("#collapseOne").collapse('toggle');$("#collapseTwo").collapse('toggle');成功

可聚合对象:

    <div class="accordion" id="accordion2">
      <div class="accordion-group mzti-transparent-border" id="id-group-1">
        <div id="id-header-1" class="accordion-heading mzti-bg-image-1">
          <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">

            </div>
          </a>
        </div>
        <div id="collapseOne" class="accordion-body collapse in">

          <div class="accordion-inner">


          </div>
        </div>
      </div>
      <div class="accordion-group hide mzti-transparent-border mzti-height" id="id-group-2">
        <div id="id-header-2" class="accordion-heading width-100 mzti-bg-image-2 margin-top-22px ">
          <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">

          </a>
        </div>
        <div id="collapseTwo" class="accordion-body collapse">
          <div class="accordion-inner">

          </div>
        </div>
      </div>
    </div>

1 个答案:

答案 0 :(得分:8)

删除data-toggle="collapse"元素

上的<a class="accordion-toggle"...