【发布时间】:2023-03-10 04:15:01
【问题描述】:
我想在鼠标悬停在标记上时具有弹跳效果,并在鼠标离开时停止动画。
我正在尝试对这样的侦听器使用 mouseover 和 mouseout 事件:
google.maps.event.addListener(marker, 'mouseover', function() {
this.setAnimation(google.maps.Animation.BOUNCE);
});
google.maps.event.addListener(marker, 'mouseout', function() {
this.setAnimation(null);
});
但这看起来很奇怪。 我无法用语言解释错误的行为 - 请看我录制的这个 15 秒视频:
===> http://youtu.be/Hcy8823nNQU
我需要的可能是 mouseleave 而不是 mouseout,但他们的 API 没有提供该事件。
【问题讨论】:
标签: google-maps google-maps-api-3 google-maps-markers