jquery hooverintent 与谷歌地图 gmarker
假设我有一个像这样的 Google 地图 v2 GMarker:
var marker = new GMarker(point, {
icon :myicon,
title :'whatever'
});
GEvent.addListener(marker, "mouseover", function() {
myover(pointid);
});
GEvent.addListener(marker, "mouseout", function() {
myout(pointid);
});
我想要类似于 jquery 的行为——hoverintent,而不是正常的 mouseover 和 mouseout 事件,以避免在屏幕上移动鼠标并意外触摸 GMarker 时的过度活动。我希望仅当鼠标减慢或停在标记处时才触发我的功能。这可以使用普通 dom 元素(例如表行 (tr))的悬停意图来解决。
我的问题是,我不知道如何使用 jQuery 选择 GMarker。 如果无法完成,我如何以其他方式将我的 GMarkers 挂接到悬停意图?
谢谢,
Say I have a Google maps v2 GMarker like this:
var marker = new GMarker(point, {
icon :myicon,
title :'whatever'
});
GEvent.addListener(marker, "mouseover", function() {
myover(pointid);
});
GEvent.addListener(marker, "mouseout", function() {
myout(pointid);
});
I would like behavior similar to jquery - hoverintent instead of the normal mouseover and mouseout events, to avoid hyperactivity when moving the mouse across the screen and accidentally touching a GMarker. I would like my functions to be triggered only when the mouse slows down or stops at a marker. This can be solved using hoverintent for normal dom-elements such as table rows (tr).
My problem is, I do not know how to select a GMarker using jQuery.
If it cannot be done, how do I hook my GMarkers into hoverintent in some other way?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我根据这个答案自行解决了这个问题:
延迟jquery悬停事件?
这只会给出延迟,而不会缓慢移动鼠标光标,但目前已经足够了。
结果是这样的:
I kind of solved this by rolling my own based on this answer:
Delay jquery hover event?
This only gives the delay without the slow moving mouse cursor, but it is enough for now.
This is what it turned out: