如何保持jQuery UI手风琴默认折叠? [英] How do I keep jQuery UI Accordion collapsed by default?
本文介绍了如何保持jQuery UI手风琴默认折叠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用jQuery UI Accordion,它工作得很好,但是除非我单击它,否则我希望手风琴保持关闭状态.
I am working with jQuery UI Accordion and it works great but I would like to have the accordion stay closed unless it I click on it.
我现在正在使用此代码,可以将其切换为关闭状态:
I am using this code right now, which allows be to toggle it closed:
$("#accordion").accordion({ header: "h3", collapsible: true });
是否可以默认关闭它,除非单击它?
Is there a way to have it closed by default unless it is clicked?
谢谢.
推荐答案
Add the active: false
option (documentation)..
$("#accordion").accordion({ header: "h3", collapsible: true, active: false });
这篇关于如何保持jQuery UI手风琴默认折叠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文