JsTree:改变“开放”方式使用“类型”的文件夹图标插件
使用“types”插件可以轻松指定关闭文件夹的图标。但是 types 插件是否也可以用于指定 open 文件夹的外观,或者我只能使用 CSS 来执行此操作(如下所示)?
li.jstree-open > a .jstree-icon
{
background:url("folder_open.png") 0px 0px no-repeat !important;
}
It's easy to specify what the icon should be for a closed folder using the "types" plugin. But can the types plugin also be used to specify what an open folder should look like, or can I only do this with CSS (like below) ?
li.jstree-open > a .jstree-icon
{
background:url("folder_open.png") 0px 0px no-repeat !important;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
一种可能的解决方案是有两种
type
- 一种用于打开的文件夹,另一种用于关闭的文件夹。更改节点类型
很容易。来自我的另一个答案:
A possible solution is to have two
type
s - one for an open folder, and one for a closed folder. Changing the nodetype
is easy.From another answer of mine:
@第七个元素:
问题本身中的代码就是答案。它工作得很好。
对于开放节点使用
对于封闭节点使用
Cheers
@Seventh element:
Your code in the question itself is the answer.It works pretty fine.
For open node use
For closed nodes use
Cheers
如果你们想使用 jQuery 和 bootstrap 图标,这是我的解决方案。
或者如果您使用的是 font-awesome:
If you guys want to use jQuery and bootstrap icon, here is my solution.
or if you are using font-awesome:
看来您需要
在 jsTree 论坛
Looks like you need to use css
more info in the jsTree forum
今天,有一个名为“set_icon”的函数(请参阅 API ),允许您从路径字符串或类名设置 Desider 图标。
At today, there is a function called "set_icon" (see API), that allow you to set the desider icon, from a path string or a class name.