您的位置:首页 > 其它

图片移动上去加一个遮罩蒙版

2016-01-26 18:30 274 查看
1鼠标移上去在图片上层添加一个蒙版
下边附上代码和实现效果案例
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://code.jquery.com/jquery-latest.js"></script>

<link rel="stylesheet" type="text/css" href="css/animate.min.css"/>
</head>
<style type="text/css">
#xx{
position: relative;width: 200px;height: 200px;
}
.mb{
height:200px; width:200px;
background-color:#9e9e9e;filter:Alpha(Opacity=60);position:absolute;opacity:0.6;top:0;left:0;z-index:10;
text-align:center;
}
#mb_text{
line-height: 200px;
}
.current{
display: none;
}
</style>
<script type="text/javascript">
$(function(){
$("#xx").hover(function(){
$("#mm").toggle();
});
})
</script>
<body>
<div id="xx" class="img">
<img src="http://img30.360buyimg.com/cf/jfs/t2272/225/1335281049/8046/14afb9a/565805c1Nb3eb3c63.jpg" style="width: 200px;height: 200px;"/>
<div id="mm" class="mb current">
<span id="mb_text" class="animated bounceIn">
<a href="#" onclick="alert('123')">----  更多   ----</a>
</span>
</div>

</div>
</body>
</html>


// $(function(){
$("#xx").hover(function(){
$("#mm").toggle();
});
})
// ]]>



---- 更多 ----
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: