jquery - Bootstrap 3 数据切换 Accordion

标签 jquery css twitter-bootstrap accordion

这是我的

<a data-toggle="collapse" href="#collapsible-1">Digital</a>

  <div id="collapsible-1">
        HTML stands for HyperText Markup Language. HTML is the main markup language for describing the structure of Web pages.</a>
  </div>

<a data-toggle="collapse" href="#collapsible-2">Radio</a>

  <div id="collapsible-2">
        HTML stands for HyperText Markup Language. HTML is the main markup language for describing the structure of Web pages.</a>
  </div>

我使用 data-toggle boostrap 来显示和隐藏元素,但我有一些小问题,这样,当页面加载时,可折叠的内容总是可见的,即使我必须做两次单击以关闭该元素,然后就可以正常工作了。你认为我必须做什么,才能折叠元素内容以在页面加载时始终隐藏?

最佳答案

取自Bootstrap's documentation :

Usage
The collapse plugin utilizes a few classes to handle the heavy lifting:

.collapse hides the content
.collapse.in shows the content
.collapsing is added when the transition starts, and removed when it finishes

简而言之:<div id="collapsible-1" class='collapse'>

关于jquery - Bootstrap 3 数据切换 Accordion ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21258863/

相关文章:

css - 我可以将 Bootstrap 2.3.1 与 4.0 或 3.x.x 等新版本合并吗?

javascript - 如何添加边框但不改变内容位置

javascript - 将数据转换为百分比 HighCharts

css - safari web-kit 浏览器页面渲染与 css

html - 为什么我不能移动背景?

jquery - 具有不同按钮的多个 Bootstrap 模式链接到各自的内容不起作用

javascript - JS/jQuery 同时按住 LMB 事件

javascript - 选择随机列表项并添加类别

jquery - overflow hidden 不适用于 jQuery .css 单击事件

html - 向上移动按钮以与 h2 文本对齐