87,904
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE>
<html>
<head>
<meta charset = "utf-8" />
<script src = "http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
<script>
//$().ready(function(){
//$(".div1").mouseover(function(){
//$(".div2").show();
//} )
/*$("img").mouseenter(function(event){
event.stopPropagation();
$(".div2").stop().css("display","inline");
} )
.mouseleave(function(event){
event.stopPropagation();
$(".div2").stop().css( "display", "none");
} )
} )
*/
$().ready(function(){
$(".div1").mouseenter(function(){
$(".div2").clearQueue();
$(".div2").addClass("modal");
} )
.mouseleave(function(){
$(".div2").clearQueue();
$(".div2").removeClass("modal");
} )
})
</script>
<style>
.div1 {
width:100px;
height:100px;
}
img {
width:100px;
}
.modal {
width:100px;
height:100px;
background-color:grey;
position:absolute;
left:8px;
top:0;
opacity:0.6;
}
</style>
</head>
<body>
<div class = "div1">
<div>
<img src = "6011443968.jpg">
</div>
</div>
<div class = "div2" >
</div>
</body>
</html>