首页 > 解决方案 > CSS 样式中的 JS 树自定义

问题描述

我正在尝试为我的一项任务创建一个树结构列表。我打算为此使用JS-TREE 插件。该插件仍然具有许多功能,我必须做一些样式更改以匹配给定的设计。

这是我尝试过的代码笔链接,

1. Change the plus-square with angle-down icon
2. Change the minus-square with angle-up icon
3. change the square-filled-grey icon(will come if any few of child nodes selected) with minus-square icon
4. Hover blue highlighting not needed

有什么方法可以定制这个吗?或者根据您的经验有任何超级热门插件吗?

标签: javascripthtmlcss

解决方案


因此,看起来他们正在使用精灵图并更改背景位置以选择出现的图标

我能够移动这个

.jstree-proton .jstree-anchor > .jstree-undetermined {
    background-position: -38px -5px;
}

这满足了#3。如果您检查任何图标(jstree-icon 类),您将看到分配给 32.png 的背景。您必须更改那里存在的图标的位置。对于上下角度,您必须隐藏他们提供的背景图像并插入您自己的图标


推荐阅读