这是js部分;
html贴上吧:
- 1
- 2
- 3
- 4
css额:
.slidebox{width: 900px;height: 310px;margin: 0 auto; z-index: 0;position: relative;}
.slide{z-index: 1;position: absolute;}
.btns{z-index: 9999;bottom: 10px;position: absolute;right: 5px;}
.slide img{width: 900px;height: 310px;}
.slidebox ul li {width:18px;height: 18px; float: left;margin-right: 5px;text-align: center;background: #666;font: 12px arial;line-height: 18px;text-decoration: none;color: #fff;}
.slidebox ul .current{background: #f33;}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
不同于getElementById(), getElementsByTagName()返回的不是一个element,而是一个a list of elements,所以应该这样写: