jQuery UI Accordion(默认隐藏所有)
Hello I am using jQuery UI Accodions
By default, the first accordion is shown and other are hidden. I would like to hide all the accordions by default until the user clicks it.
How do I do that ?
Thank You
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这段代码应该可以完成这个任务
This code should accomplish this
这是完成相应操作的更新代码。
$( ".selector" ).accordion({active: false , collapsible: true});
This is the updated code to accomplish the appropriate.
$( ".selector" ).accordion({active: false , collapsible: true});
“将 active 设置为 false 将折叠所有面板。这需要将可折叠选项设置为 true。”
http://api.jqueryui.com/accordion/#option-active
"Setting active to false will collapse all panels. This requires the collapsible option to be true."
http://api.jqueryui.com/accordion/#option-active
要默认隐藏所有手风琴面板,您需要设置以下 2 个选项:
active 选项指定当前打开哪个面板。默认情况下它的值为0,即第一个面板。
collapsible 选项指定是否可以一次关闭所有部分。允许折叠活动部分。
To hide all the accordion's panel by default, you need to set the following 2 options:
The active option specifies which panel is currently open. By default its value is 0, i.e the first panel.
The collapsible option specifies whether all the sections can be closed at once. Allows collapsing the active section.