jQuery JSTree-添加工具提示 [英] JQuery JSTree - add a ToolTip

查看:142
本文介绍了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();

这篇关于jQuery JSTree-添加工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆