【发布时间】:2019-07-22 13:59:19
【问题描述】:
我在 adminlte 中有一个可折叠的盒子。默认情况下,当页面加载时,它会展开。如何让它默认折叠?
这是我用来制作盒子的:
https://adminlte.io/docs/2.4/js-box-widget
我的 HTML:
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Collapsible Box Example</h3>
<div class="box-tools pull-right">
<!-- Collapse Button -->
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
The body of the box
</div>
<div class="box-footer">
The footer of the box
</div>
</div>
我的脚本:
<script>
$('.box').boxWidget({
animationSpeed: 500,
collapseTrigger: '#my-collapse-button-trigger',
removeTrigger: '#my-remove-button-trigger',
collapseIcon: 'fa-minus',
expandIcon: 'fa-plus',
removeIcon: 'fa-times',
hide: true
})
【问题讨论】:
-
您可以在没有脚本的情况下轻松地在 HTML 中完成所有折叠操作。有关示例,请参阅getbootstrap.com/docs/4.3/components/collapse。
-
谢谢,但我想使用管理框。
标签: jquery html bootstrap-4 collapse adminlte