点击左右按钮发现圆点current没能实现移动,自己做的第二遍,第一遍跟着老师做实现了,第二遍再次对照发现找不出问题所在了

点击左右按钮发现圆点current没能实现移动,自己做的第二遍,第一遍跟着老师做实现了,第二遍再次对照发现找不出问题所在了

html部分​(超链接)

请问该如何上传问题,这一节代码过多!

//js部分

 // 姓名:马炎

 // 时间:2020年11月15日

 // 轮播图效果制作:

 (function(){

     //dom获取盒子

     var carousel_list=document.getElementById('carousel_list');

     var right_btn=document.getElementById('right_btn');

     var left_btn=document.getElementById('left_btn');

     //克隆一张图片

     var clone_li=carousel_list.firstElementChild.cloneNode(true);

     //上树

     carousel_list.appendChild(clone_li);

     //添加点击事件

     var idx=0;

     right_btn.onclick=function(){

         //循环一遍再次添加过渡效果

         carousel_list.style.transition='transform .5s linear 0s'

       

         idx++;

         carousel_list.style.transform='translateX('+-16.66*idx+'%)';

         //当到第五张时停止过渡效果,但是又要有过渡效果回到第一张所以用延时器

         if(idx>4){

             setTimeout(function(){

                carousel_list.style.transform='none';

                carousel_list.style.transition='none';

                //重新回到第0张

                idx=0;

             },500)  

         } 

           //调用函数

           setCircles();     

     };

     left_btn.onclick=function(){

         if(idx==0){

             //瞬间拉动到最后

            carousel_list.style.transition='none';

            //拉到最后瞬间移动

            carousel_list.style.transform='translateX('+-16.66*5+'%)';

            idx=4;

            //添加延时器0秒

            setTimeout(function(){

                //延迟0毫秒后跳转到第四张加上过渡

                carousel_list.style.transition='transform .5s linear 0s';

                carousel_list.style.transform='translateX('+-16.66*4+'%)';

               

            },0)

            

         }else{

            idx--;

            carousel_list.style.transform='translateX('+-16.66*idx+'%)';

         }

         //调用函数

         setCircles();

     }

        //利用dom得到盒子

        var circle_ol=document.getElementById('circle_ol');

        var circle_lis=circle_ol.getElementsByClassName('li');

     //进行小圆点的切换 点击按钮小圆点跟着切换

      function setCircles(){

        forvar i=0;i<=4;i++){

            if(i==idx){

                circle_lis[i].className='current';

            }else{

                circle_lis[i].className='';

            }

        }

     }

 })()


//css部分


.header-top{

    min-width1152px;

    height150px;

    background-color: rgb(228187187);

}

.A{

    min-width1152px;

    height32px;

    background-color#2A2A2A ;

    line-height32px;

}

.header-top .A .center-wrap{

  

}

.header-top .A .center-wrap .right .iconfont{

    floatright;

    margin-right16px;

    line-height32px;

}

.header-top .A .center-wrap .right .iconfont:first-child{

    margin-right0;

}


.header-top .A .center-wrap .right .dr,.zc{

    font-size12px;

    color#FFFFFF;

    text-alignjustify;

    line-height32px;

}

.header-top .A .center-wrap .A1{

    floatleft;

    

}

.header-top .A .center-wrap .A1ulli{

    /* 大于号表示父亲的第一任儿子 */

    font-size14px;

    floatleft;

    margin-right18px;

    

}

.header-top a{

    font-family: PingFangSC-Regular;

   

    color#FFFFFF

    text-alignjustify;

    line-height18px;

}

.header-top .A .center-wrap .A1ulli.a1{

    /* li里面本身的一个a1元素用交集 */

    

    padding-right:12px;

    positionrelative;

    

}

.header-top .A .center-wrap .A1>ul>li.a1 .menu{

    /* 应该用top这样盒子就会在a1顶部往下延伸 */

    positionabsolute;

    top:32px;

    left0;

    width121px;

    

    background-color:rgba(0,0,0,0.20) ;

    displaynone

    box-shadow0 4px 8px 0;

    z-index9999;

}

.header-top .A .center-wrap .A1>ul>li.a1 .menu .menua2{

    width72px;

}

.header-top .A .center-wrap .A1>ul>li.a1 .menu .menua2 a{

    colorblack;

}



.header-top .A .center-wrap .A1>ul>li.a1 .menu .menua3{

    

}

.header-top .A .center-wrap .A1>ul>li:hover .menu{

    displayblock;

}


.header-top .A .center-wrap .A1ulli.a1 .B{

    positionabsolute;

    right0;

    top50%;

    margin-top-6px;

    width12px;

    height12px;

    

    transition: transform 0.2s linear 0s;

}

.header-top .A .center-wrap .A1ulli.a1:hover .B{

    transform:rotate(180deg)

}

/* 先两个盒子使用绝对定位然后微调,然后大盒子hover,

    之后控制大盒子transition旋转速度 */

.header-top .A .center-wrap .A1ulli.a1 .B .aa1{

    positionabsolute;

    left2px;

    top4px;

    width6px;

    height6px;

    background-color: rgb(248248246);

    transform: rotate(45deg);

}

.header-top .A .center-wrap .A1ulli.a1 .B .aa2{

    positionabsolute;

    top2px;

    left2px;

    width6px;

    height6px;

    background-color#2A2A2A;

    transform: rotate(45deg);

}


.main-nav{

    min-width1152px;

    background-color#20BD9A;

    height40px;

}

.main-nav .center-wrap ul li{

    floatleft;

    margin-right18px;

    line-height40px;

    font-size16px;

    positionrelative;

}

.main-nav .center-wrap ul li .ddwl{

    positionabsolute;

    width172px;

    top:40px;

    left0;

   background-color: rgb(207231100);

   displaynone;

    

    z-index9999;

}

.main-nav .center-wrap ul li .ddwl a{

    /* 自己权重上a标签不要写错了 */

    colorblack;

}

.main-nav .center-wrap ul li:hover .ddwl{

    displayblock;

}

.main-nav .center-wrap ul li{

    padding-right16px;

}

.main-nav .center-wrap ul li .b1{

    positionabsolute;

    right0;

    top50%;

    margin-top0px;

    /* transparent透明色 */

    border8px solid transparent;

    border-top-color:white;

    border-bottomnone;

    transition: transform 0.2s linear 0s;

}

.main-nav .center-wrap ul li:hover .b1{

    transform: rotate(180deg);

}

.log-area{

    height78px;

    background-color#fff;

}

.log-area h1{

    floatleft;

    font-size24px;

    color#20BD9A;

    text-alignjustify;

    line-height78px

    margin-right20px;

}

.log-area input{

    floatleft;

    width373px;

    height30px;

    opacity0.3;

    border1px solid #20BD9A;

    border-radius8px 0 0 8px;

    margin-top24px;

    /* 取消默认的外线(外线是文本框特有的东西) */

    outlinenone;

}

.log-area .iconfont{

    floatleft;

    margin-top24px;

    width32px;

    height30px;

    background-color#20BD9A;

    border-radius0 4px 4px 0;

    font-size20px;

    text-aligncenter;

    line-height30px;

}

.banner{

  

    positionrelative;

}


.banner .carousel_list{

    width600%;

    /* 清除浮动 */

    overflowhidden;

    /* 拉动本身的16.67%,translateX中的百分数表示相对他自身的宽度多少倍 */

   /* transform:translateX(-16.67%); */

   transition: transform .5s linear 0s;   //添加过渡

}

.banner .carousel_list li{

    floatleft;

    width16.666%;

}

.banner .carousel_list li img{

    width100%;

     /* 这是一个小技巧,添加后就不会产生小缝隙了 */

     vertical-alignmiddle;

    

}


.banner .center-wrap{

    positionabsolute;

    width1152px;

    height100%;

    top0;

    left50%;

    margin-left:-576px;

    /* 隐藏可见 */

    overflowvisible;

    

}

.banner .left-btn{

    positionabsolute;

    width28px;

    height44px;

    background:url(../images/icons.png) no-repeat -21px -94px;

    left-38px;

    top50%;

    margin-top-22px;

}

.banner .left-btn:hover{

    opacity0.8;

}

.banner .right-btn{

    positionabsolute;

    width28px;

    height44px;

    /* 精灵技术先导入图片 */

    background:url(../images/icons.png) no-repeat -21px -29px;

    right-38px;

    top50%;

    margin-top-22px;

    

}

.banner .right-btn:hover{

    opacity0.8;

}

.banner .center-wrap ul{

    height100%;

}

.banner .center-wrap ul li{

    positionrelative;

    height16.66%;

    width296px;

    opacity0.5;

    border-bottom1px solid white;

    background#1C1F21;

    /* 然多余的部分全部融到盒子内 */

    box-sizingborder-box;

}

.banner .center-wrap ul li:last-child{

    border-bottomnone;

}

.banner .center-wrap ul li dl{

    positionabsolute;

    height48px;

    width296px;

    top50%;

    margin-top-24px;

    left40px;

    font-size14px;

    color#FFFFFF;

    text-alignjustify;

    line-height22px;

}   

.banner .center-wrap ul li dl dt{

    font-size18px;

    color#FFFFFF;

    text-alignjustify;

    line-height26px;

}

/* 方法一使用绝对定位来制作,方法二使用::before制作 */

.banner .center-wrap ul li .E{

    /* 方法一使用绝对定位制作 */

    positionabsolute;

    width:24px;

    height24px;

    background-color: rgb(205236119);

    top50%;

    margin-top-12px;

    left:10px ;

    background: url(../images/icons.png) no-repeat -27px -397px;

}

/* 方法二使用::before制作 */

.banner .center-wrap ul li::before {

    content:'' ;

    /* 共性 */

    positionabsolute;

    width24px;

    height24px;

    left10px;

    top50%;

    margin-top-12px;

    background-coloryellow;

    background-image: url(../images/icons.png);

}

.banner .center-wrap ul li.d2::before {

    background-position:  -27px -397px;

}

.banner .center-wrap ul li.d3::before{

    background-position-27px -259px;

}

.banner .center-wrap .menu21{

    /* 让所有menu21隐藏 */

    displaynone;

    positionabsolute;

    width324px;

    height100%;

    top0;

    left296px;

    opacity0.7;

    background#1C1F21;

    padding16px;

    /* 超出盒子部分隐藏 */

    box-sizingborder-box;

}

.banner .center-wrap .menu21 dt{

    font-size16px;

    color#FFFFFF;

    text-alignjustify;

    line-height24px;

    margin-bottom4px;

}

.banner .center-wrap .menu21 dl{

    margin-bottom12px;

}

.banner .center-wrap .menu21 dd a{

    font-size14px;

    color#FFFFFF;

    text-alignjustify;

    line-height22px;

}

.banner .current_ol{

    positionabsolute;

    width150px;

    height20px;

    bottom10px;

    left50%;

    margin-left-75px;

}

.banner .current_ol li{

    floatleft;

    width20px;

    height20px;

    margin-right10px;

    background-color: rgb(12023891);

    border-radius10px;

}

.banner .current_ol li:last-child{

    margin-right0;

}

.banner .current_ol li.current{

    width30px;

    background-color#20BD9A;

}

    

.hot-ads{

    /* 清除浮动方法一,

    方法二,添加overflow:hidden 

    方法三,clear:both*/

    clearboth;

}

.hot-ads ul li{

    floatleft;

    margin32px 32px 32px 0;


}

.hot-ads ul li:last-child{

    margin-right0;

}

.xxsw{

    width100%;

    height738px;

    background#F7F7F7;

}

.xxsw .center-wrap{

    height658px;

    padding:40px 0 0 0;

    


}



.xxsw ul li{

    floatleft;

    margin-right32px;

    margin-bottom32px;

    background#FFFFFF;

    line-height22px;

}

.xxsw ul li:hover{

    box-shadow0 8px 16px 0 rgba(0,0,0,0.20);

}

.xxsw ul li:nth-child(4n){

    margin-right0;

}

.xxsw .xxsw-head h2{

    floatleft;

    font-size36px;

    color#1C1F21;

    text-alignjustify;

    line-height54px;

}

.xxsw .xxsw-head em{

    /* 也可使用相对定位来调整/这样要简单些 */

    floatleft;

    font-size12px;

    color#1C1F21;

    text-alignjustify;

    line-height18px;

    margin-left12px;

    margin-top27px;

}

.xxsw ul{

    margin-top32px;

}

.xxsw ul p{

    width236px;

    height58px;

    font-size14px;

    color#1C1F21;

    line-height22px;

    padding14px;

}

.jjzyx{

    height738px;

    background#FFFFFF;

    

    

}

.jjzyx .center-wrap{

    height658px;

    padding:40px 0 40px 0;

    

    positionrelative;

}

.jjzyx .jj-1 h2{

    floatleft;

    font-size36px;

    color#1C1F21;

    text-alignjustify;

    line-height54px;

}

.jjzyx  .jj-1 em{

    /* 也可使用相对定位来调整/这样要简单些 */

    floatleft;

    font-size12px;

    color#1C1F21;

    text-alignjustify;

    line-height18px;

    positionrelative;

    top31px;

    left:12px ;

    

}

.jjzyx .jj-2 ul li{

    floatright;

    margin-right16px;

    margin-top12px;

    

}

.jjzyx .jj-2 ul li:first-child{

    margin-right0px;

}

.jjzyx .jj-2 ul li a{

    font-size14px;

    line-height22px;

    colorblack;

}

.jjzyx .jj-2 ul li.jj-4 a{

    color#20BD9A;

}

.jjzyx .jj-2 ul li.jj-4 {

    

    border-bottom:4px solid #20BD9A;

    padding-bottom4px;

}

.jjzyx .bdulli{

    floatleft;

  margin:32px 32px 0 0;

  

}

.jjzyx .bdulli:hover{

    box-shadow0 4px 8px 0 rgba(0,0,0,0.08);

}

.jjzyx .bd ul li:nth-child(3){

    margin-right0;

}


.jjzyx .bd ul li p.jjzyx-a{

    width236px;

    height62px;

    font-size14px;

    color#1C1F21;

    line-height22px;

    padding12px;

}

.jjzyx .bd ul li .jjzyx-1{

    positionrelative;

}


.jjzyx .bd  ul li .jjzyx-1 .jjzyx-A{

    positionabsolute;

    /* 内容区域+padding区域就是盒子大小 */

    width508px;

    height51px;

    left0px;

    bottom0px;

    background#1C1F21;

    opacity0.55;

    padding26px;

    font-size14px;

    color#FFFFFF;

    line-height22px;

}

.jjzyx .bd .para2{

    positionabsolute;

    right0px;

    bottom36px;

    width264px;

    height224px;

    padding-top46px;

    background-image: linear-gradient(180deg#34E3BC 0%#15AF7A 98%);

    box-shadow0 4px 8px 0 rgba(0,0,0,0.08);

}

.bd .para2 p{

    text-aligncenter;

    color#FFFFFF;

}

.bd .para2 p.iconfont{

    font-size48px;

    positionrelative;

    top20px;  

    color#FFFFFF

}

.jjzyx .center-wrap .bd .para2 ul{

    margin36px 14px 46px 25px;

}

.jjzyx .center-wrap .bd .para2 ul li{

    floatleft;

    margin-right10px;

    border-right:1px solid white;

    padding-right15px;

    font-size14px;

    color#FFFFFF;

    text-aligncenter;

    line-height22px;

}

.jjzyx .center-wrap .bd .para2 ul li:last-child{

    margin-right0;

    border-rightnone;

}

.ddwl{

    height586px;

    background-color#F7F7F7;

    /* 建立全屏板块背景颜色为后面板块居中做准备 */

    

}

.ddwl .center-wrap{

    height506px;

    padding:40px 0 40px 0;

    /* 建立主要编辑板块已经成功居中 */

    positionrelative;

}

.ddwl .wl-1 h2{

    /* 头部板块以左右浮动来编辑,此处左浮动 */

    floatleft;

    font-size36px;

    color#1C1F21;

    text-alignjustify;

    line-height54px;

}

.ddwl  .wl-1 em{

    /* 也可使用相对定位来调整/这样要简单些 */

    floatleft;

    font-size12px;

    color#1C1F21;

    text-alignjustify;

    line-height18px;

    positionrelative;

    top31px;

    left:12px ;

    

}

.ddwl .wl-2 ul li{

    /* 此处右浮动并且头部要设置清除浮动为

    接下来图片编辑做准备 */

    floatright;

    margin-right16px;

    margin-top12px;

    

}

.ddwl .wl-2 ul li:first-child{

    /* 右浮动清除的margin是第一个 */

    margin-right0px;

}

.ddwl .wl-2 ul li a{

    font-size14px;

    line-height22px;

    colorblack;

}

.ddwl .wl-2 ul li.wl-4 a{

    /* a标签颜色得单独来设置 */

    color#20BD9A;

}

.ddwl .wl-2 ul li.wl-4 {

    /* 通过设置li元素边框来达到下划线效果 */

    border-bottom:4px solid #20BD9A;

    padding-bottom4px;

}

.ddwl .center-wrap .bd-2{

    height420px;

    margin32px 0;

    background-color: rgb(240186186);

}

.ddwl .center-wrap .bd-2 .bd-a,

.ddwl .center-wrap .bd-2 .bd-b,

.ddwl .center-wrap .bd-c{

    floatleft;

    width364px;

    height420px;

    background-color: rgb(211243169);

    margin-right30px;

}

.ddwl .center-wrap .bd-2 .bd-c{

    /* 巧妙利用权重关系把bd-c的右边margin去掉 */

    margin-right0;

}

.bd-a .big{

    positionrelative;

    width364px;

    height270px;

    margin-bottom30px;

}

.bd-a .big .wenzi{

    positionabsolute;

    width364px;

    height104px;

    font-size14px;

    color#FFFFFF;

    line-height22px;

    left0;

    bottom0;

    opacity0.5;

    background#1C1F21;

    padding17px 21px;

    box-sizingborder-box;

}


.bd-a .big .wenzi .cswl{

    floatleft;

}

.bd-a .big .wenzi .cswl-1{

    floatright;

}

 .big-1{

    width364px;

    height120px;

    background-color: rgb(159238156);

    margin-bottom:30px ;

}

 .big-1 img{

    floatleft;

}

 .big-1 p{

    floatleft;

    width208px;

    height66px;

    margin26px 18px 28px 18px;

}

/* 或者直接.bd-2 .big-1 */


 .bd-c .para2{

    width364px;

    height270px;

    padding-top46px;

    box-sizingborder-box;

    background-image: linear-gradient(180deg#FF6374 1%#FF7368 98%);

    box-shadow0 4px 8px 0 rgba(0,0,0,0.08);

}

.bd-c .para2 p{

    text-aligncenter;

    color#FFFFFF;

    

}

.bd-c .para2 p.iconfont{

    font-size48px;

    positionrelative;

    top20px;  

    color#FFFFFF

}

.bd-c .para2 ul{

    margin36px 27px 46px 27px;

}

.bd-c .para2 ul li{

    floatleft;

    margin-right10px;

    border-right:1px solid white;

    padding-right15px;

    font-size14px;

    color#FFFFFF;

    text-aligncenter;

    line-height22px;

}

.bd-c .para2 ul li:last-child{

    margin-right0;

    border-rightnone;

}

.tsddy{

    height456px;

    padding-top40px;

    box-sizingborder-box;

}

.tsddy .center-wrap h2{

    text-aligncenter;

    font-size36px;

    color#1C1F21;

    

    line-height54px;

}

.tsddy .center-wrap .te{

    floatleft;

    margin-right32px;

}

.tsddy .center-wrap .te:last-child{

    margin-right0;

}

.tsddy .center-wrap .te-A .te{

    width264px;

    height290px;

    background#FFFFFF;

    box-shadow0 8px 16px 0 rgba(0,0,0,0.20);

}

.tsddy .center-wrap .te-A h4{

    width242px;

    height48px;

    margin16px 8px 8px 14px;

    

    font-size16px;

    font-weightbold;

    color#000000;

    line-height24px;

}

.tsddy .center-wrap .te-A ul li{

    floatleft;

    font-size12px;

    color#000000;

    line-height18px;

}

.tsddy .center-wrap .te-A ul li.xx{

    color#FA6400 ;

}

.tsddy .center-wrap .te-A ul{

    margin9px 8px 16px 14px;

}

.tsddy .center-wrap .te-A{

    margin32px 0;

}

.sdlx{

    height738px;

    background#FFFFFF;

    

    

}

.sdlx .center-wrap{

    height658px;

    padding:40px 0 40px 0;

    

    positionrelative;

}

.sdlx .sd-1 h2{

    floatleft;

    font-size36px;

    color#1C1F21;

    text-alignjustify;

    line-height54px;

}

.sdlx .sd-1 em{

    /* 也可使用相对定位来调整/这样要简单些 */

    floatleft;

    font-size12px;

    color#1C1F21;

    text-alignjustify;

    line-height18px;

    positionrelative;

    top31px;

    left:12px ;

    

}

.sdlx .sd-2{

    floatright;

    

    margin-top12px;

    

}

.sdlx .sd-2{

    font-size14px;

    line-height22px;

    color#20BD9A;

}


.sdlx .sd-2 li{  

    border-bottom:4px solid #20BD9A;

    padding-bottom4px;

}

.sdlx .bdulli{

    floatleft;

  margin:32px 32px 0 0;

  

}

.sdlx .bdulli:hover{

    box-shadow0 4px 8px 0 rgba(0,0,0,0.08);

}

.sdlx .bd ul li:nth-child(3){

    margin-right0;

}


.sdlx .bd ul li p.sdlx-a{

    width236px;

    height62px;

    font-size14px;

    color#1C1F21;

    line-height22px;

    padding12px;

}

.sdlx .bd ul li .sdlx-1{

    positionrelative;

}


.sdlx .bd  ul li .sdlx-1 .sdlx-A{

    positionabsolute;

    /* 内容区域+padding区域就是盒子大小 */

    width508px;

    height51px;

    left0px;

    /* 利用绝对定位超出隐藏原理,

    然后为浮动出现做准备 */

    bottom-80px;

   

    opacity0.55;

    padding26px;

    font-size14px;

    color#FFFFFF;

    line-height22px;

    

}

.sdlx .bd  ul li .sdlx-1:hover .sdlx-A{

    /* 设置浮动效果 */

    bottom0;

    /* 设置浮动运动速度 */

    transitionbottom .4s linear 0s;

}

.sdlx .bd .para2{

    positionabsolute;

    right0px;

    bottom40px;

    width264px;

    height224px;

    padding-top46px;

    background-image: linear-gradient(180deg#BD5EE8 0%#832ABB 98%);

    box-shadow0 4px 8px 0 

}

.bd .para2 p{

    text-aligncenter;

    color#FFFFFF;

}

.bd .para2 p.iconfont{

    font-size48px;

    positionrelative;

    top20px;  

    color#FFFFFF

}

 .center-wrap .bd .para2 ul{

    margin36px 14px 46px 25px;

}

 .center-wrap .bd .para2 ul li{

    floatleft;

    margin-right10px;

    border-right:1px solid white;

    padding-right15px;

    font-size14px;

    color#FFFFFF;

    text-aligncenter;

    line-height22px;

}

 .center-wrap .bd .para2 ul li:last-child{

    margin-right0;

    border-rightnone;

}

/* 公共类应用 */

.bzzy .center-wrap .sd-2 ul li{

    floatright;

    margin-right20px;

}

.bzzy .center-wrap .sd-2 ul li.bzzy-1{

   margin-right0;

   border-bottomnone;

   color#000;

}

.bzzy .center-wrap .bd .para2 ul {

    padding-left40px;

}

.bzzy .center-wrap .bd .para2{

    background-image: linear-gradient(180deg#41D8E9 0%#3685EA 98%);

    box-shadow0 4px 8px 0 rgba(0,0,0,0.08);

}

/*公共类特效实现 */

.content-part img:hover{

    transform: scale(1.1);

}

.content-part .bd,.te-A,.bd-2,.center-wrap{

    overflowhidden;

}

.content-part img{

    transition: transform 0.4s linear 0s;

}

/* 公共类特效动画实现 */

.content-part .para2 .iconfont{

    animation: ud 0.4s linear 0s alternate infinite ;

}

@keyframes ud{

    from{

        transform: translateY(-10px);

    }

    to{

        transform: translateY(10px);

    }

}

.content-part .bd .sdlx-1{

    positionrelative;

   

}

.content-part .bd .circle{

    positionabsolute;

    width106px;

    height106px;

    border1px solid white;

    top-162px;

    left50%;

    margin-left-53px;

    colorwhite;

    border-radius50%;

    padding-top26px;

    box-sizingborder-box;

}

.content-part .bd .circle p{

    font-size18px;

    text-aligncenter;   

}

.content-part .sdlx-1:hover .circle{

    /* 一碰就会回到原来位置 */

    top62px;

}

footer{

    height220px;

    background#F7F7F7;

}

footer .center-wrap{

    padding-top36px;

}

footer .center-wrap .part-a ul li{

    floatleft;

    border-right1px solid rgb(192152152);

    padding-right22px;

    margin-right:22px ;

    font-size18px;

    color#1C1F21;

    line-height28px;

    

}

footer .center-wrap .part-a ul li:last-child{

    border-rightnone;

    margin-right0;

}

footer .center-wrap .part-a ul{

    margin-bottom40px;

}

footer .center-wrap .part-b dd{

    width289px;

    height44px;

    

}

footer .center-wrap .part-b dt{

    font-weightbold;

    margin-bottom:8px;

}


footer .center-wrap .part-b dl{

    floatleft;

    padding-left75px;

}

footer .center-wrap .part-b .ccsx{

    margin0 30px;

}

footer .center-wrap dl{

    positionrelative;

}

footer .center-wrap .txfw-1{

    /* 利用新建立一个div方式来实现精灵技术 */

    positionabsolute;

    width60px;

    height60px;

    left0;

    bottom0;

    

    background-image: url(../images/icons.png);

    background-position-150px -178px;

}

footer .center-wrap .ccsx::before{

    content'';

    /* 利用::before content实现,好处是少建立一个盒子 */

    positionabsolute;

    width60px;

    height60px;

    left0;

    bottom0;

    background:url(../images/icons.png) -150px -105px;

}

footer .center-wrap .axph::before{

    content'';

    positionabsolute;

    width60px;

    height60px;

    left0;

    bottom0;

    background: url(../images/icons.png) -150px -32px;

}






正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

5回答
曼曼前端 2021-04-28 12:59:58

Transform表达式里的那个百分号的分引号写错位置了。在括号的外面去了。

好帮手慕久久 2020-11-17 10:55:30

同学你好,要细心、有耐心、多练习,没有捷径可走呦~!

祝学习愉快!

  • 提问者 Vigorous阿炎 #1
    嗯嗯,谢谢建议。
    2020-11-17 11:52:26
好帮手慕久久 2020-11-17 09:19:43

同学你好,使用F12结合控制台只是找bug的一种方式,该种方式不能解决一切bug,很多时候,还是需要我们看代码、屡逻辑才能解决的,而这种能力是需要积累的。

祝学习愉快!

  • 提问者 Vigorous阿炎 #1
    好的,谢谢。刚才返回顶部这一节(function(){ })();这个函数最后两个括号差点又忘记写,点击事件没实现,最后检查发现了这个问题!
    2020-11-17 10:24:35
好帮手慕久久 2020-11-16 18:41:31

同学你好,js也可以通过F12,打开控制台来找bug,如下:

http://img1.sycdn.imooc.com//climg/5fb2567009bd77fa14990429.jpg

点击报错右侧,会跳转到出错代码附近:

http://img1.sycdn.imooc.com//climg/5fb256cd09527b1f19060282.jpg

http://img1.sycdn.imooc.com//climg/5fb256e909ee975308820409.jpg

报错截图上的语句含义是“不能给undefined设置className”,所以就要想一下是不是元素没获取到,这样就查到了方法写错了。

祝学习愉快!

  • 提问者 Vigorous阿炎 #1
    噢噢,明白了,感谢!
    2020-11-16 20:56:17
好帮手慕久久 2020-11-16 17:19:41

同学你好,获取小点时,使用的方法不对,应该利用标签名获取小点,修改如下:

http://img1.sycdn.imooc.com//climg/5fb24308091f86bc07160168.jpg

另外,setCircles中,需要处理一下idx的值,如下:

http://img1.sycdn.imooc.com//climg/5fb243730921cf7d06710348.jpg

由于问答区对字符个数有限制,所以代码较多时,可以把与内容相关的代码粘贴出来,比如这里比较关键的就是轮播图部分,同学可以把轮播图部分的结构、样式、js粘贴出来,其他部分的内容可以不用粘。另外,练习时,建议使用和老师一样的类名和结构,这样老师可以使用源码中的部分内容测试。完全练会后,再自己随意写结构和样式。

祝学习愉快!

  • 提问者 Vigorous阿炎 #1
    谢谢,您是通过什么方法检测出问题的呢?css可以通过f12快捷键查找问题,那js文件有其他方法快速检测出bug吗?
    2020-11-16 18:32:10
  • 提问者 Vigorous阿炎 #2
    您说的这种确实可以检测,但是我刚才出现了一个问题没有var出banner这个盒子,自己也找了很久才发现是这个问题。按照您说的方法按f12检测发现控制面板上啥都没有。 //var banner = document.getElementById('banner') //得到盒子 var timer; timer = setInterval(right_btn_dingshigd, 2000); banner.onmouseenter = function () { clearInterval(timer); }
    2020-11-16 21:03:55
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师