Files
ClassContent/历届学生/陈一航/2020-04-07/index.html
2024-09-27 02:06:13 +08:00

110 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>js轮播</title>
<link rel="stylesheet" href="./clear.css">
<style>
.main {
width: 520px;
height: 280px;
border: 1px solid #000;
overflow: hidden;
position: relative;
margin: 30px auto;
}
.daohang {
position: absolute;
width: 520px;
height: 36px;
top: 50%;
margin-top: -18px;
z-index: 2;
}
.fs {
width: 40px;
height: 40px;
border-radius: 50%;
color: #fff;
background: #000;
text-align: center;
line-height: 40px;
cursor: pointer;
}
.dh_left {
float: left;
}
.dh_right {
float: right;
}
.lb_img{
width: 1560px;
position: relative;
transition: all 0.3s ease;
}
.lb_img li {
float: left;
}
.yd {
position: absolute;
bottom: 15px;
left: 50%;
margin-left: -37.5px;
}
.yd li {
width: 15px;
height: 15px;
border-radius: 100%;
background: #fff;
float: left;
margin-right: 10px;
}
.active {
background: red !important;
}
</style>
</head>
<body>
<div class="main">
<div class="daohang">
<div class="fs dh_left"> < </div>
<div class="fs dh_right"> > </div>
</div>
<ul class="lb_img" style="left: 0px">
</ul>
<ul class="yd">
</ul>
</div>
</body>
<script src="./swiper.js"></script>
<script>
var ListData = [
{ id: 1, href: 'https://www.baidu.com', imgUrl: 'https://aecpm.alicdn.com/simba/img/TB1XotJXQfb_uJkSnhJSuvdDVXa.jpg' },
{ id: 1, href: 'https://www.baidu.com', imgUrl: 'https://aecpm.alicdn.com/simba/img/TB1JNHwKFXXXXafXVXXSutbFXXX.jpg' },
{ id: 1, href: 'https://www.baidu.com', imgUrl: 'https://img.alicdn.com/tfs/TB1VZo7x4v1gK0jSZFFXXb0sXXa-520-280.jpg_q90_.webp' }
];
new Swiper({
time: 1,
containerClassName: '.lb_img',
NavigationClassName: '.yd',
next: '.dh_left',
previous: '.dh_right',
data: ListData
})
</script>
</html>