<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./js/jquery.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
ul {
width: 300px;
height: 200px;
}
img {
width: 100px;
height: 100px;
}
li {
width: 100px;
height: 100px;
list-style: none;
float: left;
}
</style>
</head>
<body>
<ul>
<li>
<a href="https://www.ctyun.cn/portal/link.html?target=%22%26gt%3B%26lt%3Bimg+src%3D"./img/1.png" alt=""></a>
</li>
<li>
<a href="https://www.ctyun.cn/portal/link.html?target=%22%26gt%3B%26lt%3Bimg+src%3D"./img/2.png" alt=""></a>
</li>
<li>
<a href="https://www.ctyun.cn/portal/link.html?target=%22%26gt%3B%26lt%3Bimg+src%3D"./img/3.png" alt=""></a>
</li>
<li>
<a href="https://www.ctyun.cn/portal/link.html?target=%22%26gt%3B%26lt%3Bimg+src%3D"./img/1.png" alt=""></a>
</li>
<li>
<a href="https://www.ctyun.cn/portal/link.html?target=%22%26gt%3B%26lt%3Bimg+src%3D"./img/2.png" alt=""></a>
</li>
<li>
<a href="https://www.ctyun.cn/portal/link.html?target=%22%26gt%3B%26lt%3Bimg+src%3D"./img/3.png" alt=""></a>
</li>
</ul>
<script>
$(function() {
$("ul li").hover(function() {
$(this).siblings().stop().fadeTo(400, 0.5);
}, function() {
$(this).siblings().stop().fadeTo(400, 1);
})
});
</script>
</body>
</html>
运行结果