1. 程式人生 > 其它 >javascript寫淡入淡出效果的輪播圖

javascript寫淡入淡出效果的輪播圖

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #box{
            width:590px;
            height: 470px;
            position: relative;
            border: 1px solid;
            margin: 100px auto;
        }
        #imgList{
            width: 590px;
            height: 470px;
            position: relative;
            list-style: none;
        }
        #imgList li{
            width: 590px;
            height: 470px;
            position: absolute;
            top: 0;
            left: 0;
            display: none;
        }
        #num{
            width: 590px;
            height: 50px;
            position: absolute;
            bottom: 0;
            left: 0;
            background-color: #fdd;
            line-height: 50px;
        }
        #num i{
            display: inline-block;
            width: 20px;
            height: 20px;
            margin: 0 10px;
            background-color: #fff;
            border-radius: 50%;
            cursor: pointer;
        }
        #prve,#next{
            width: 45px;
            height: 100px;
            background: pink;
            position: absolute;
            top: 0;
            bottom: 0;
            margin: auto;
            color: #fff;
            text-align: center;
            line-height: 100px;
            font-size: 30px;
            cursor: pointer;
        }
        #next{
            right: 0;
        }
        #box .on{
            background-color:aquamarine;
        }
    </style>
</head>
<body>