240 发简信
IP属地:宁夏
  • 那我说下吧,第一个功能的最后一张图,第一个if(isgo == false){} 的“{}”括号少了 }号 if(isgo == false) {
    count++;

    //transform:translate():含义:变动,位移;如下表示向右位移120像素,如果向上位移,
    // 把后面的“0”改个值就行,向左向下位移则为负“-”。
    oulimg.style.transform = "translate(" + -800 * count + "px)";

    if (count >= oliimg.length - 1) {

    count = oliimg.length - 1;
    isgo = true;
    }
    }
    else{
    count--;
    oulimg.style.transform = "translate(" + -800 * count + "px)";
    if(count <=0){
    count = 0;
    isgo = false;
    }
    }

    十五分钟用JavaScript基础写一个图片轮播效果 + 思路详解

    前言 这次也是一个适合JavaScript初学者的小练手,用JavaScript的基本知识去写一个轮播图,其实轮播图有很多方法去实现,像用一些框架,Bootstrap之类的,...