2016-01-16 53 views
1

我正在使用Inspinia主題。jQuery展開全部並用inspinia全部摺疊

An example page

如果單擊每個易寶右上角的圖標fa-chevron,它崩潰易寶。

我想用摺疊全部按鈕摺疊所有的iboxes。然後用全部展開按鈕展開它們。

的按鈕看起來像:

<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

Wheres the code? – Zapp

+0

只需在提供的鏈接上點擊查看源代碼 – user1022379

回答

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');