jQuery扩展all并使用inspinia崩溃

时间:2016-01-16 19:26:12

标签: javascript jquery html css twitter-bootstrap

我正在使用Inspinia主题。

An example page

如果您点击每个ibox右上角的fa-chevron图标,它会折叠ibox。

我想使用全部折叠按钮折叠所有ibox。然后使用展开全部按钮展开它们。

按钮看起来像:

<button type="button" data-action="expand-all" class="btn btn-white btn-sm">Expand All</button>
<button type="button" data-action="collapse-all" class="btn btn-white btn-sm">Collapse All</button>

我想点击"Collapse All",然后点击所有最小化面板按钮。

如何?

1 个答案:

答案 0 :(得分:3)

我不确定您使用的是哪个版本,但对于directives.js中的AngularJS实现,您可以看到处理此问题的函数iboxTools。如果您只是想使用jQuery手动执行它,它就像:

一样简单
//slide up (or down) all ibox content
$('div.ibox-content').slideUp();

//change the chevron
$('.ibox-tools a.collapse-link i').toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
相关问题