javascript Raphael JS 在悬停时制作带有工具提示的地图

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4867943/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 15:09:52  来源:igfitidea点击:

Raphael JS to make a map with tooltips on hover

javascriptjquerysvgtooltipraphael

提问by Keith

I am trying to make a map with Raphael JS, pretty much like the example they have on their site: http://raphaeljs.com/australia.html

我正在尝试使用 Raphael JS 制作地图,非常类似于他们网站上的示例:http: //raphaeljs.com/australia.html

However, I want to show the info on hover as a tooltip that fades in/out as you move to different parts of the map (not next to the map like on their example). What is the best way to do that?

但是,我想将悬停信息显示为工具提示,当您移动到地图的不同部分(而不是像他们的示例那样靠近地图)时,该提示会淡入/淡出。最好的方法是什么?

This is what I came up with so far, but in IE (e.g. IE6 and IE7) the tooltip doesn't disappear and I'm not sure why: http://jsfiddle.net/keith/sXCk6/

这是我到目前为止想出的,但是在 IE(例如 IE6 和 IE7)中,工具提示没有消失,我不知道为什么:http: //jsfiddle.net/keith/sXCk6/

采纳答案by Keith

This posting here on Stack Overflow addresses the issue of IE and mouseover problems: Move active element loses mouseout event in internet explorer

Stack Overflow 上的这篇帖子解决了 IE 和鼠标悬停问题:在 Internet Explorer 中移动活动元素丢失鼠标悬停事件