jQuery:
$('.resume-header').hover(
function() {
$('resume-header img').css('display', 'none');
$('resume-header img').attr('src', 'media/resume-icon-download.png');
$('resume-header img').fadeIn(400);
},
function() {
$('resume-header img').css('display', 'none');
$('resume-header img').attr('src', 'media/resume-icon.png');
$('resume-header img').fadeIn(400);
}
);
注意,我所有的其他 jQuery 都在工作。
这是与之对应的HTML:
<div class="header">
<div class="me-header">
<a href="#"><img src="media/me-icon.png" alt="Picture of Christian Selig"><br> <span class="center-text">Contact Me</span></a>
</div>
<div class="resume-header">
<a href="resume.pdf"><img src="media/resume-icon.png" alt="Resume icon" title="Click to download resume (PDF)"><br> <span class="center-text">Resume (PDF)</span></a>
</div>
</div>