2014-08-27 41 views
0

我正在使用擴展插件(http://www.adipalaz.com/experiments/jquery/expand.html)。問題是我無法將內容設置爲默認擴展。Jquery expandAll - 默認情況下不能擴展

我同時使用..

  • $.fn.expandAll.defaults.state = "shown";
  • $.fn.expandAll.defaults.initTxt = "hide";

..methods和直接在腳本文件中更改默認值:

(...) 
$.fn.expandAll.defaults = { 
state : 'shown', // If 'hidden', the collapsible elements are hidden by default, else they are expanded by default 
initTxt : 'hide', // 'show' - if the initial text of the switch is for expanding, 'hide' - if the initial text of the switch is for collapsing 
(...) 

..但它不起作用,內容仍然隱藏。我發現了一個類似問題的小提琴:http://jsfiddle.net/wLEGS/22/

我會很感激任何提示,我怎麼能解決這個問題。

謝謝。

回答

0

$("your_selector").expandAll('shown');完成工作。

$(function() { 
    $(your_selector_to_expand).expandAll('shown'); 
}); 

看吧:http://jsfiddle.net/wLEGS/23/

+1

在我眼裏,這是一個評論,不是答案。 – reporter 2014-08-27 11:19:37

+0

謝謝,這是一個解決方案,而不是解決方案,但它的工作原理。我不知道我是否應該將其標記爲答案。 – PramusPL 2014-08-27 11:50:19