本文实例为大家分享了JavaScript实现轮播图片的具体代码,供大家参考,具体内容如下
JS代码注释清晰明了,一看就懂!
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>最简单的轮播效果</title> <style> * { margin: 0; padding: 0 } .box { width: 500px; height: 300px; border: 1px solid #ccc; margin: 100px auto; padding: 5px; } .inner { width: 500px; height: 300px; position: relative; overflow: hidden; } .inner img { width: 500px; height: 300px; vertical-align: top } ul { width: 1000%; position: absolute; list-style: none; left: 0; top: 0; } .inner li { float: left; } ol { position: absolute; height: 20px; right: 20px; bottom: 20px; text-align: center; padding: 5px; } ol li { display: inline-block; width: 20px; height: 20px; line-height: 20px; background-color: #fff; margin: 5px; cursor: pointer; } ol .current { background-color: red; } </style> </head> <body> <div class="box" id="box"> <div class="inner"> <!--轮播图--> <ul> <li> <div><img src="/UploadFiles/2021-04-02/001.png">精彩专题分享:jQuery图片轮播 JavaScript图片轮播
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
最新资源
- 银霞.1982-《结·SAYYESMYBOY》台湾复刻版[WAV+C
- 梁汉文1993-火热动感[引进版][WAV+CUE]
- 梁汉文2008-EDMONDHITS48[香港]3CD[WAV+CUE]
- 国风大师纯音系列《童丽-[渭城曲]》1CD[WAV分轨
- 国风大师纯音系列《许菱子《烧筝2》古筝曲集》1
- 王子异《1996 Part.2》[320K/MP3][18.29MB]
- 群星.1994-宝丽金最倾情3CD【宝丽金】【WAV+CUE
- 乐俊亨.2024-同泪【CharioticMusic】【FLAC分轨
- 何耀珊.2006-收获【华纳】【WAV+CUE】
- 梁汉文1994-壹精选[华星][WAV+CUE]