<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
a{display: blockwidth: 200pxheight: 200pxposition: relative}
img{width: 200pxheight: 200px}
div{background: #111111z-index: 999width: 200pxheight: 200pxposition: absolutetop: 8pxopacity: 0}
</style>
<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(function(){
$("div").hover(function(){
$("div").css("opacity","0.2")
$("img").css("opacity","0.65")
},function(){
$("div").css("opacity","0")
$("img").css("opacity","1")
})
})
</script>
</head>
<body>
<a href=""><img src="../img/1.jpg"/></a><div></div>
自己换一张图片,导入jQuery.min的开发库
</body>
</html>