删除 jQuery 手风琴项目
如何从 jQuery Accordion 中删除项目?我试图让用户能够从数据库中删除显示在手风琴中的项目,然后让该项目淡出。我尝试隐藏该项目的父 DIV,但标题仍然存在,并且手风琴之后无法正常工作。
这是标记(基本手风琴用法):
<div id="accordion">
<h3><a href="#">The Title - Item 1</a></h3>
<div>
The Content - Item 1
<a href="#" class="deleteItem">Delete</a>
</div>
<h3><a href="#">The Title - Item 2</a></h3>
<div>
The Content - Item 2
<a href="#" class="deleteItem">Delete</a>
</div>
</div>
谢谢!
How do you remove an item from a jQuery Accordion? I am trying to give the user the ability to delete an item from a database, displayed in an accordion, and have that item fade out after. I tried hiding the parent DIV of the item but the header remains and the accordion does not function properly after.
Here is the markup (basic accordion usage):
<div id="accordion">
<h3><a href="#">The Title - Item 1</a></h3>
<div>
The Content - Item 1
<a href="#" class="deleteItem">Delete</a>
</div>
<h3><a href="#">The Title - Item 2</a></h3>
<div>
The Content - Item 2
<a href="#" class="deleteItem">Delete</a>
</div>
</div>
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您处于内容 div 子级的点击事件中,它看起来像这样:
这是一个 工作示例。不确定手风琴是否无法工作,但如果不能,请尝试重新初始化它。
assuming you're in the click event of a child of the content div, it would look something like this:
here is a working example. not sure about the accordion not working afterword, but if it doesn't, try and re-initialize it.
如果我们有这样的情况,那么我们如何删除特定的面板。在 Jquery 的帮助下删除面板后,我也可以调用 servlet。我尝试了很多,但无法做到。请帮忙。
If we have a condition like this then how do we delete the particular panel.and after deleting the panel with the help of Jquery i can call the servlet too.I tried alot but unable to do.Please help.