87,923
社区成员
发帖
与我相关
我的任务
分享
<ul class="menu">
<li style="width:29px">
<a href="">
<img src="QQ1.png" class="icon" style="bottom: 0px; display: inline; opacity: 1;">
<img src="QQ.png" class="hover-icon" style="bottom: 150px; display: none; opacity: 1;">
</a>
</li><ul>
$(".menu li").hover(function(){
$(this).find(".icon").stop(true,true).animate({'bottom':"-150px"},"fast");
$(this).find(".icon").css('display',"none");
$(this).find(".hover-icon").stop(true,true).animate({'bottom':"0px"},"fast");
$(this).find(".hover-icon").css('display',"inline");
},function(){
$(this).find(".hover-icon").stop(true,true).animate({'bottom':"150px"},"fast");
$(this).find(".hover-icon").css('display',"none");
$(this).find(".icon").stop(true,true).css('display',"inline");
$(this).find(".icon").animate({'bottom':"0"},"fast");
}
);
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
.a1 {
width:300px;
height:300px;
border:1px solid #111;
}
.a2,.a3 {
width:100px;
height:100px;
background-color:#a11;
}
.a3 {
background-color:#9e1;
display:none;
}
</style>
</head>
<body>
<div id='waitover' class='a1'>
<a href=''>
<span class='a2'>XXXX</span>
<span id='show' class='a3'>OOOO</span>
</a>
</div>
<script>
document.getElementById("waitover").onmouseover = function(){
document.getElementById('show').style.display = 'inline';
}
</script>
</body>
</html>