手风琴在类别选择中切换箭头

时间:2017-03-29 21:09:18

标签: javascript jquery bootstrap-accordion

我已经制作了一个编写码器,以使其尽可能简单。用箭头打开树,然后单击单词以选择'那个类别。 http://codepen.io/johnsonjpj/pen/JWebwx?editors=0010

我遇到的问题是,当我点击嵌套类别时,其父项箭头会向右箭头翻转,而不是保持向下箭头。

我在这篇文章中使用的主要代码是:

public function __construct()
{
    $this->bus = new ArrayCollection();
}

提前致谢!

1 个答案:

答案 0 :(得分:0)

我已经想出如何解决我的问题。

var thisParents = $(this).parents('.list-group').not('.list-group-root');
$(".list-group").not(thisParents).collapse('hide');

var parentIcons = $(thisParents).prev('.list-group-item').find('.fa');
$(".list-group").find('.fa-chevron-down').not(parentIcons).addClass('fa-chevron-right').removeClass('fa-chevron-down');