我需要有关单击事件的帮助以了解我的步进器进度。
例如,当我点击 3 时,我在第 1 步,我将转到第 3 步
我尝试点击<li>
但不起作用
这是我的 html 和 CSS
<div class="row">
<div class="col-xs-12 col-md-8 offset-md-2 block border">
<div class="wrapper-progressBar">
<ul class="progressBar">
<li class="active"></li>
<li class=""></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</div>
CSS
.wrapper-progressBar {
width: 100%
}
.progressBar {
counter-reset: step;
}
.progressBar li {
list-style-type: none;
float: left;
width: 21%;
position: relative;
text-align: center;
}
.progressBar li:before {
cursor:pointer;
content: counter(step);
counter-increment: step;
line-height: 30px;
border-radius: 50%;
width: 30px;
height: 30px;
border: 1px solid #ddd;
display: block;
text-align: center;
margin: 0 auto 10px;
background-color: white
}
.progressBar li:after {
content: "";
position: absolute;
width: 100%;
height: 2px;
background-color: #ddd;
top: 15px;
left: -50%;
z-index: -1;
}
.progressBar li:first-child:after {
content: none;
}
.progressBar li.active {
color: green;
}
.progressBar li.active:before {
border-color: green;
background-color: white;
}
.progressBar li.active + li:after {
background-color: green;
}
https://jsfiddle.net/kingstore/jL6qyft1/3/
“我期待这个”