三张并列div上分别有三个浮动层,jquery鼠标经过时候显示浮动层,移开的时候隐藏浮动层
1个回答
2018-01-24
展开全部
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script class="jquery library" src="/js/sandbox/jquery/jquery-1.8.2.min.js" type="text/javascript"></script>
<style>
div.wrap{
margin:0 auto;
width:303px;
height:100px;
}
div.wrap>div{
background-color:red;
width:100px;
height:100px;
float:left;
display:inline-block;
margin-right:1px;
}
div.wrap>div>div{
background-color:gray;
opacity:.8;
width:100px;
height:30px;
margin-top:70px;
text-align:center;
line-height:30px;
}
</style>
<script>
$(function(){
$(".wrap>div").hover(function(){
$(this).find("div").show();
},function(){
$(this).find("div").hide();
}).find("div").hide();
});
</script>
<title></title>
</head>
<body>
<div class="wrap">
<div>
<div>1</div>
</div>
<div>
<div>11</div>
</div>
<div>
<div>111</div>
</div>
</div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询