当第三个 div 悬停在上面时,我正在尝试替换两个不同 div 的图像链接。我怎么能这样做,因为我的 jquery 不正确且不简洁。我确实意识到我不能把 this.attr 加倍,哈哈。任何帮助,将不胜感激。谢谢。
$('#minerallink').hover(function() { // On mouseenter
$('#brainicon, #stomachicon').stop(true, true).fadeOut(function() { // Fade out the image, and when done
$(this).attr('src', 'health-tips/images/images/medicineman-icons-dark_01.png', ).fadeIn();
$(this).attr('src', 'health-tips/images/images/medicineman-icons-dark_04.png').fadeIn(); // Change its source and fade in
});
$('#manpic5').stop(true, true).fadeOut(function() { // Fade out the image, and when done
$(this).attr('src', 'health-tips/images/images/medicineman-dark_05.png').fadeIn(); // Change its source and fade in
});
},
function() { // On mouseleave - reverse the process
$('#brainicon, #stomachicon').stop(true, true).fadeOut(function() {
$(this).attr('src', 'health-tips/images/images/medicineman-icons_01.png').fadeIn();
$(this).attr('src', 'health-tips/images/images/medicineman-icons_04.png').fadeIn();
});
$('#manpic5').stop(true, true).fadeOut(function() {
$(this).attr('src', 'health-tips/images/images/medicineman_05.png').fadeIn();
});
});