gpt4 book ai didi

javascript - Jstree展开后图标变化

转载 作者:行者123 更新时间:2023-11-30 20:43:00 26 4
gpt4 key购买 nike

我有来自 font awesome 的图标。

<li data-jstree='{"icon":"fa fa-envelope-o"}'>
<span id="id">Description</span>
<ul>
<li data-jstree='{"disabled":true}'>
<span id="id">Documents</span>
</li>
</ul>
</li>

enter image description here

当我打开节点时,图标会变为原始状态。

enter image description here

我只有'fa fa-envelope-o'有问题,如果我用像'fa fa-envelope-open-o'这样的另一个测试它就可以了。

谢谢。

最佳答案

我找到了这个解决方案,也许还有更好的方法。

$('#TreeId').on("close_node.jstree", function (e,data) {    
setTimeout(function(){
$("#" + data.node.id).find('i').eq(1).removeClass('fa-minus-circle fa-plus-circle');
}, 1);
});

关于javascript - Jstree展开后图标变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49045666/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com