jquery-ui 手风琴:添加行而不破坏和重新创建?
我有一个 jquery 手风琴,我想向其中添加行。我可以通过调用 .accordion("destroy"),添加所需的
... 位,然后再次调用 .accordion() 来完成此操作,但这会破坏状态并关闭所有打开的分隔线。是否可以向手风琴添加行而不破坏并重新创建它?
I have a jquery accordion which I want to add rows to. I can accomplish this by calling .accordion("destroy"), adding the needed <h3></h3><div>
... bit and then calling .accordion() again, but this destroys the state and closes any dividers which are open.
Is it possible to add rows to the accordion without destroy and recreating it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是不可能的。 jQuery 应该向 Accordion 添加一个“add”方法,就像选项卡一样:
将其包装在一个很好的方法中,扩展 Accordion,提交补丁等。我没有测试这个,但它应该可以工作。如果选项卡插入到活动手风琴项目之前,而不是附加到末尾,您可能需要调整状态值。
No it is not possible. jQuery should add an "add" method to accordion like they have for tabs:
Wrap it in a nice method, extend accordion, submit a patch, etc. I didn't test this but it should work. You might have to adjust the state value if the tab was inserted before the active accordion item, instead of appended to the end.