Html
    Css
    Js

    
                        
body,ul{margin: 0;padding:0}
li{list-style: none}
button:focus{outline: 0}
.wrap,.btn{
    position: relative;
    width:600px;
    height: 335px;
    margin: 35px auto
}
.btn{ height: 65px; text-align: center;}
.wrap>ul>li{
    position: absolute;
    display: none;
    width:100%;
    height:100%;
    color:#fff;
    text-align:center;
    line-height:335px;
    font-size:48px;
}
.wrap>ul>li.active{ display: block;}
.arrow{
    position: absolute;
    width: 25px;
    height: 50px;
    top:50%;
    margin-top: -25px;
    color:#fff;
    line-height: 50px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(51,136,125,.5);
}
.arrow:hover{ background-color: rgba(51,136,125,.9);}
.a-left{ left: 0;}
.a-right{right: 0;}
.intro{
    position: absolute;
    width: 100%;
    height: 38px;
    line-height: 38px;
    font-size:16px;
    color:#fff;
    text-align: center;
    background-color: rgba(0,0,0,.6);
}
.t-num{ top: 0;}
.b-title{ bottom: 0;}
.btn>button{
    width: 100px;
    height: 38px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    background-color: MediumVioletRed;
    border:solid 1px #ccc;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    margin: 15px;
    cursor: pointer;
}
.btn>button.active{background-color: orange}
.btn>button:hover{background-color: #935404}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

原生js写的带标题和序号的轮播图

代码简单易修改,注释清晰明了

0