简易轮播图(最全代码解析)JavaScript(ES6面向对象)

本文详细解析了如何使用JavaScript(ES6语法)的面向对象编程方式来创建一个简易轮播图,提供了完整的代码示例,帮助读者理解并实现轮播效果。
摘要由CSDN通过智能技术生成

 完整代码:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>ES6轮播图</title>
    <script></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .box {
            width: 500px;
            height: 300px;
            border: 1px solid silver;
            overflow: hidden;
            margin: auto;
            margin-top: 50px;
            position: relative;
            top: 0;
            left: 0;
        }
        .outer {
            list-style: none;
            position: absolute;
            top: 0;
            left: 0;
            transition: .3s all linear;
        }
        .img {
            width: 500px;
            height: 300px;
            float: left;
        }
		.btns span {
			position: absolute;
			width: 25px;
			height: 40px;
			top: 50%;
			margin-top: -20px;
			line-height: 40px;
			text-align: center;
			font-weight: bold;
			font-family: Simsun;
			font-size: 30px;
			border: 1px solid silver;
			opacity: 0.5;
			cursor: pointer;
			color: #fff;
			background: black;
		}
		.btns .left {
			left: 5px;
		}
		.btns .right {
			left: 100%;
			margin-left: -32px;
		}
        .right > :first-child, .left > :first-child {
            width: 35px;
            height: 35px;
        }
        .oOl {
            width: 163px;
            position: absolute;
            right: 0;
            left: 0;
            margin: auto;
            bottom: 10px;
            list-style: none;
        }
        .oLi {
            width: 25px;
            height: 25p
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值