jquery accordion with dynamic content

与世无争的帅哥 提交于 2019-12-11 08:18:55

问题


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:


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

If you have a read above, mrfr0g says he built a custom accordion based on jQuery UI 1.8.2, give that a try.




回答2:


give the inner DIV of each tab an id and use document.getElementById("content1").innerHTML = "HelloEveyOne345443333334422" to dynamically change the content of each tab



来源:https://stackoverflow.com/questions/5927365/jquery-accordion-with-dynamic-content

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!