JavaScript图片轮播图

本文介绍了如何使用JavaScript实现一个四张图片每隔2秒自动切换的轮播图效果,为网页添加动态展示。
摘要由CSDN通过智能技术生成

四张图片每隔2秒换下一张

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		*{padding: 0;margin: 0;}
		body{background-color: green;}
		#cou{width: 540px;height: 400px;margin: 30px auto;position: relative;}
		#content img{width: 540px;height: 400px;}
		#content div{display: none;}
		#content div.on{display: block;}

		ol,li{list-style: none;}
		ol{position: absolute;bottom: 15px;left: 50%;transform: translateX(-50%);}
		.item li{float: left;width: 10px;height: 10px;border-radius: 50%;background-color: #fff;
			margin-right: 10px;}
		.item li.current{background-color: orange;}

		.arrow{width: 32px;height: 32px;display: inline-block;position: absolute;
			top: 184px;background: rgba(255,255,255,0.3);display: none;}
		.arrow img{width: 28px;height: 28px;margin-top: 2px;}
		.ar{right: 0px;transform: rota
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值