|
@@ -61,6 +61,7 @@
|
|
position: absolute;
|
|
position: absolute;
|
|
opacity: 0.4;
|
|
opacity: 0.4;
|
|
top: 215px;
|
|
top: 215px;
|
|
|
|
+ display: none;
|
|
}
|
|
}
|
|
|
|
|
|
#next {
|
|
#next {
|
|
@@ -101,52 +102,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
<script>
|
|
- var btn = document.getElementsByTagName('li')
|
|
|
|
- var imgs = document.getElementsByClassName('selected')
|
|
|
|
- var next = document.getElementById('next')
|
|
|
|
- var prev = document.getElementById('prev')
|
|
|
|
- iNow = 0
|
|
|
|
- for (var i = 0; i < btn.length; i++) {
|
|
|
|
- btn[i].index = i
|
|
|
|
- btn[i].onclick = function () {
|
|
|
|
- // for (var j = 0; j < btn.length; j++) {
|
|
|
|
- // btn[j].className = ''
|
|
|
|
- // imgs[j].className = 'selected'
|
|
|
|
- // }
|
|
|
|
- //btn[this].className = 'select'
|
|
|
|
- // this.className = 'select'
|
|
|
|
- // imgs[this.index].className = 'selected choice'
|
|
|
|
- iNow = this.index
|
|
|
|
- console.log(iNow)
|
|
|
|
- myFun(iNow)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //点击下一个事件
|
|
|
|
- next.onclick = function () {
|
|
|
|
- iNow++;
|
|
|
|
- console.log(iNow)
|
|
|
|
- if (iNow > 4) {
|
|
|
|
- iNow = 0
|
|
|
|
- }
|
|
|
|
- // for (var i = 0; i < btn.length; i++) {
|
|
|
|
- // for (var j = 0; j < btn.length; j++) {
|
|
|
|
- // btn[j].className = ''
|
|
|
|
- // imgs[j].className = 'selected'
|
|
|
|
- // }
|
|
|
|
- // btn[iNow].className = 'select'
|
|
|
|
- // imgs[iNow].className = 'selected choice'
|
|
|
|
- // }
|
|
|
|
- myFun(iNow)
|
|
|
|
- }
|
|
|
|
|
|
|
|
- var myFun = function (xx) {
|
|
|
|
- for (var j = 0; j < btn.length; j++) {
|
|
|
|
- btn[j].className = ''
|
|
|
|
- imgs[j].className = 'selected'
|
|
|
|
- }
|
|
|
|
- btn[xx].className = 'select'
|
|
|
|
- imgs[xx].className = 'selected choice'
|
|
|
|
- }
|
|
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|
|
|
|
|