如何让 jQuery UI Accordion 在默认情况下保持折叠状态? [英] How do I keep jQuery UI Accordion collapsed by default?
本文介绍了如何让 jQuery UI Accordion 在默认情况下保持折叠状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 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?
推荐答案
添加 active: false
选项 (文档)..
Add the active: false
option (documentation)..
$("#accordion").accordion({ header: "h3", collapsible: true, active: false });
这篇关于如何让 jQuery UI Accordion 在默认情况下保持折叠状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文