如何使用jQuery销毁/删除活动手风琴 [英] How to destroy / Delete Active accordion using jquery

查看:52
本文介绍了如何使用jQuery销毁/删除活动手风琴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何才能破坏其中包含的所有内容的活动手风琴.

How can we destroy active accordion with all the content is have in it.

我从此功能开始

function DesctroyThisAccordion() {
var active = jQuery("#accordion").accordion('option', 'active');
 jQuery("#accordion").accordion('option', 'active').remove('h3');
jQuery("#accordion").accordion('option', 'active').remove('div');
}

我正在将jQuery UI插件用于手风琴

I am using jQuery UI plugin for accordion

我正在尝试查找活动的手风琴并删除其h3和div内容.

I am trying to find the active accordion and delete its h3 and div content.

如果我选择手风琴中的最后一个,我就可以工作

i works if i select the last in accordion

//jQuery("h3[class^='Title']:last").remove('h3');
//jQuery("div[class^='ui-accordion-content']:last").remove('div');

但是我想让它成为活跃的手风琴

But i want it for active accordion

任何帮助将不胜感激.

推荐答案

由于我在此问题上没有找到任何帮助. 我找到了解决方案,这对有同样需求的人可能会有帮助.

Since i didn't find any help on this question. I found solution, which may be helpful for any who are in same need.

jQuery("h3[class^='Title'][aria-selected='true']").remove('h3');
jQuery("div[class^='ui-accordion-content'][style^='display: block;']").remove('div');

这篇关于如何使用jQuery销毁/删除活动手风琴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆