简体   繁体   English

工具提示是否有跨浏览器方式?

[英]Is there a cross-browser way for tooltips?

I am working with d3.js for rendering my graphs. 我正在使用d3.js来渲染我的图形。 For some reason, I am not a huge fan of svg title because of the delay it incurs and the inability to style them. 出于某种原因,我不是svg冠军的忠实粉丝,因为它会产生延迟并且无法设计它们。 Please do correct me if I am wrong. 如果我错了,请纠正我。 I recently came across, tipsy but it does not seem to be cross-browser compatible. 我最近遇到了, 醉意 ,但它似乎并没有被跨浏览器兼容。

For instance, consider this . 例如,考虑一下 The tooltips work just fine in Firefox and Chrome but do not appear even in IE 9 and I'm not sure what's going on. 工具提示在Firefox和Chrome中运行良好,但即使在IE 9中也不会出现,我不确定发生了什么。 Is there a cleaner cross-browser approach for tooltips compatible with d3.js other than using the svg title attribute? 除了使用svg title属性之外,是否有更清晰的跨浏览器方法来处理与d3.js兼容的工具提示?

EDIT : I am looking for something that works with d3.js. 编辑 :我正在寻找适合d3.js的东西。 For instance, using tipsy, we do the following: 例如,使用tipsy,我们执行以下操作:

$("svg circle").tipsy({});

This works in Firefox and Chrome but not IE. 这适用于Firefox和Chrome,但不适用于IE。 Similar thing was observed when using the tooltip plugin of Twitter's Bootstrap. 使用Twitter的Bootstrap的工具提示插件时观察到类似的事情。 Here's my jsFiddle without the tooltip added to enable quick tests. 这是我的jsFiddle 没有添加工具提示以启用快速测试。

This might be what you're looking for. 这可能就是你要找的东西。 I haven't tested it in IE9 but I would imagine it works. 我没有在IE9中测试它,但我认为它的工作原理。

http://twitter.github.com/bootstrap/javascript.html#tooltips http://twitter.github.com/bootstrap/javascript.html#tooltips

qTip is a good plugin for cross-platform tooltips. qTip是跨平台工具提示的一个很好的插件。

JQueryUI 1.9 will soon be adding support for tooltips . JQueryUI 1.9即将添加对工具提示的支持

JQuery Tooltip is lightweight and have a nice compability, i've got good results in projects where i used it. JQuery Tooltip是轻量级的,具有很好的兼容性,我在使用它的项目中取得了很好的效果。

http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM