老师麻烦看下哪里的问题
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>全屏的云南旅游相册</title>
<link rel="stylesheet" type="text/css" href="trip.css">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<span></span>
<nav>
<a href="#">泸沽湖</a>
<a href="#">丽江古城</a>
<a href="#">茶马古道</a>
<a href="#">云逸客栈</a>
<a href="#">西双版纳</a>
<a href="#">云南红酒庄</a>
<a href="#">轿子雪山</a>
<a href="#">普者黑</a>
<a href="#">海埂大坝</a>
<a href="#">玉龙湾</a>
<a href="#">昆明郊野公园</a>
<a href="#">欧洲风琴小镇</a>
</nav>
<div>
<img src="images/1.jpg">
<img src="images/2.jpg">
<img src="images/3.jpg">
<img src="images/4.jpg">
<img src="images/5.jpg">
<img src="images/6.jpg">
<img src="images/7.jpg">
<img src="images/8.jpg">
<img src="images/9.jpg">
<img src="images/10.jpg">
<img src="images/11.jpg">
<img src="images/12.jpg">
</div>
</body>
</html>
* {
margin: 0;
padding: 0;
border: none;
text-decoration: none;
}
html,
body {
overflow: hidden;
height: 100%;
background: #93b3c6;
}
span {
display: block;
width: 16px;
height: 16px;
margin: 15px auto 30px;
border-radius: 50%;
background: #fff;
}
nav {
display: flex;
width: 80vw;
margin: 0 auto 25px;
justify-content: space-between;
position: relative;
}
nav::before {
position: absolute;
top: 15px;
width: 100%;
height: 10px;
background: #fff;
display: block;
content: '';
}
nav>a {
font-size: 14px;
padding: 10px;
border: 2px solid #5395b4;
color: #255d7e;
background: #fff;
position: relative;
}
div {
position: relative;
overflow: hidden;
width: 80vw;
height: 75vh;
margin: 0 auto;
background: #fff;
box-shadow: 0 0 30px 0 rgba(8, 1, 3, 0.3)
}
div>img {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: 98%;
height: 96%;
}
$(document).ready(function(){
$("a").click(function(){
$("img").eq($(this).index()).css({"opacity":"1"}).siblings().css("opacity","0");
});
});
点击以后没有效果
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星