<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
}
#d7 {
position: relative;
}
#d7 img {
width: 100%;
display: block;
}
.dot_box {
position: absolute;
width: 48px;
bottom: 30px;
left: 50%;
margin-left: -24px;
}
.dot {
width: 10px;
height: 10px;
border-radius: 5px;
background-color: #fff;
margin-right: 6px;
float: left;
}
.dot_active {
background-color: #0058AA;
background-color: #fff;
display: none;
}
</style>
</head>
<body>
<div id="box">
<img src="../image/banner01-banner01.png" alt="" class="d7" id="d10">
<img src="../image/banner02-banner02.png" alt="" class="d7" id="d8">
<img src="../image/banner03-banner03.png" alt="" class="d7" id="d9">
<div class="dot_box">
<div class="dot dot_active"></div>
<div class="dot" id="d12"></div>
<div class="dot" id="d11"></div>
</div>
</div>
<script>
var box1 = document.querySelectorAll('#box')
var box_d7 = document.querySelector('#box .d7')
var box_d8 = document.querySelector('#box .dot_box')
var box_d9 = box_d8.querySelector('.dot')
for (var k in box_d9) {
box_d9.onclik = function () {
box_d7.style.display = none;
box_d9.style.backgroundColor = "#fff";
box_d9.style.backgroundColor = "#0058aa";
}
}
</script>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星