【发布时间】:2017-04-10 04:30:06
【问题描述】:
尝试在映射图像上实现悬停效果时遇到问题。我有一个带有映射区域的图像,在所有这些区域上,我想在悬停时显示不同的图像。
你可以在这里看到我到目前为止的工作:
http://mantasmilka.com/map/pries-smurta.html
问题是当我将鼠标悬停在区域上时它会显示图像,但是当我移动光标(不离开该区域)时它开始闪烁。它需要一个像素一个像素的区域空间。
我尝试过使用 Javascript 和 jQuery 解决方案:
Javascript:
mouseenter="document.getElementById('Vilnius').style.display = 'block';" mouseleave="document.getElementById('Vilnius').style.display = 'none';"
jQuery:
$('.hide').hide();
setTimeout(function(){
$("#area-kaunas").mouseenter(function(){
$('#Kaunas').show();
});
$("#area-kaunas").mouseleave(function(){
$('#Kaunas').hide();
});
}, 500);
【问题讨论】:
标签: javascript jquery hover mapping area