具有动态内容的jQuery手风琴 [英] jquery accordion with dynamic content
问题描述
我的初始页的div为空.一个ajax事务用合适的h3/div内容填充它.如果我在没有任何内容之前调用.accordion(),则它将无效.如果在加载第一个内容后调用它,则第一个内容看起来不错.但是,第二次调用不起作用.我真的需要销毁并重做吗?
My initial page has an empty div. An ajax transaction fills it with suitable h3/div content. If I call .accordion() before there's any content, it has no effect. If I call it after the first content is loaded, the first content looks good. Calling it a second time, however, does not work. Do I really need to destroy and redo?
推荐答案
此刻,您必须使用正式的稳定版销毁并重新创建整个内容.已经有针对它的功能请求,预定用于1.next
: http://bugs.jqueryui.com/票证/4672
At the moment you have to destroy and re-create the whole thing using the official stable release. There is already a feature request for it, scheduled for 1.next
: http://bugs.jqueryui.com/ticket/4672
如果您读过上面的文章,mrfr0g说他基于jQuery UI 1.8.2构建了一个自定义手风琴,请尝试一下.
If you have a read above, mrfr0g says he built a custom accordion based on jQuery UI 1.8.2, give that a try.
这篇关于具有动态内容的jQuery手风琴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!