如果用户悬停时间超过 x 毫秒,则打开信息窗口
我想做的非常简单:
仅当用户将鼠标悬停在标记上的时间超过 x 毫秒时才打开标记的信息窗口。
我在任何地方都找不到如何做到这一点。我希望能有一些代码片段来向我展示如何设置它!
What I'm trying to do is very simple:
open the marker's info window only if the user has hovered on the marker for longer than x millisecond.
I can't find how to do this anywhere. I would appreciate a little code snippet to show me how to set this up!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jQuery HoverIntent 插件也许可以帮助您
http://cherne.net/brian/ resources/jquery.hoverIntent.html
hoverIntent 是一个尝试确定用户意图的插件...就像水晶球一样,只需移动鼠标即可!它的工作原理类似于(并且源自)jQuery 的内置悬停。但是,它不会立即调用 onMouseOver 函数,而是等到用户的鼠标速度足够慢后再进行调用。
The jQuery HoverIntent plugin might be able to help you
http://cherne.net/brian/resources/jquery.hoverIntent.html
hoverIntent is a plug-in that attempts to determine the user's intent... like a crystal ball, only with mouse movement! It works like (and was derived from) jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, it waits until the user's mouse slows down enough before making the call.
实际上,我终于在 Google 地图群组上找到了解决方案: http://groups.google.com/group/google-maps-api/browse_thread/thread/73cf193d42a0bbfe/fa531a39b353d198?lnk=gst&q=open+hover #fa531a39b353d198
祝所有深夜编码员好运:)
Actually I finally found the solution to it on the Google Maps Group here: http://groups.google.com/group/google-maps-api/browse_thread/thread/73cf193d42a0bbfe/fa531a39b353d198?lnk=gst&q=open+hover#fa531a39b353d198
Best of luck to all the late night coders out there :)