【发布时间】:2014-11-06 16:46:58
【问题描述】:
最近正在使用图像地图并尝试在图像地图悬停时做一些事情。当然,我首先尝试了.hover(),但没有奏效,所以当我尝试.mouseover() 时,它奏效了。
我的问题是,为什么一个有效而另一个无效?
/*This function works*/
$(document).on('mouseover', '#some-map', function(){
console.log('I am hovering with mouseover()');
}).on('mouseout', function(){
console.log('I am no longer hovering with mouseover()');
});
/*This function does not work*/
$(document).on('hover', '#some-map', function(){
console.log('This is from hover()');
}, function(){
consoel.log('Out from hover()');
});
【问题讨论】:
标签: jquery html image imagemap