当我鼠标悬停在标记上时,我希望有弹跳效果,并且当mouseleave时停止动画.
我试图在监听器上使用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);
});
Run Code Online (Sandbox Code Playgroud)
但这看起来很奇怪.我无法用言语解释错误的行为 - 请看我录制的15秒视频:
===> http://youtu.be/Hcy8823nNQU
我需要的可能是mouseleave而不是mouseout,但该事件不是由他们的API提供的.