我正在尝试使用JavaScript在已定义的<area>
上淡出另一张图片,但我无法让它淡出甚至只是.show()
不同的图片。我使用下面的代码:
// Runs when the DOM has been loaded
$(document).ready(function() {
// Check if map exists
if($('#map')) {
// Loop through each AREA in the imagemap
$('#map area').each(function() {
// Assigning an action to the mouseover event
$(this).mouseover(function(e) {
var journey_id = $(this).attr('id').replace('area_', '');
$('#'+journey_id).fadeIn('medium');
});
// Assigning an action to the mouseout event
$(this).mouseout(function(e) {
var journey_id = $(this).attr('id').replace('area_', '');
$('#'+journey_id).hide();
});
});
}
});