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