jQuery JSTree-添加工具提示
是否可以将工具提示添加到
Is there a way to add a Tooltip to a JSTree node? I would like to display extra information when the user hovers over an element.
在谈到JQuery时,我非常密集,因此可能有一个明显的答案.
I'm pretty dense when it comes to JQuery so there may be an obvious answer to this.
多亏了下面的zzzz,我能够弹出一个简单的悬停框.尽管将树的div
放在fieldset
内,我仍然无法对其应用精美的JQuery工具提示,如工具提示页面中的说明所建议的那样.
Thanks to zzzz below, I am able to get a simple hover box to pop up. I still cannot apply a fancy JQuery Tooltip to it despite putting the tree's div
within a fieldset
as the instructions within the Tooltip page would suggest.
我使用create_node
函数动态创建我的jstree:
I create my jstree dynamically using the create_node
function:
$("#my_tree").jstree("create_node",
"my_node",
"inside",
{ "attr": { "id": "my_node" },
"data": { "attr": { "class": "show_tooltip",
"title": "my tooltip text" },
"title": "my node text" } } );
然后我将.show_tooltip
类定义为工具提示:
$(".show_tooltip").tooltip();
And then I define the .show_tooltip
class as tooltip:
$(".show_tooltip").tooltip();