js中for循环问题

来源:5-2 float浮动去空格

22不小了

2015-10-07 23:23


if (trigger && length > 0) {
    trigger.onclick = function() {
        for (var index = 0; index < length; index += 1) {
            buttons[index].style["cssFloat" in trigger.style? "cssFloat": "styleFloat"] = "left";
        }
    };
}


for循环这里 ; index += 1这么写有啥目的,平时我们写的不都是index++么

写回答 关注

2回答

  • echo_kinchao
    2015-10-08 10:27:15

    一样的意思 只是简写而已

  • 化龙贝
    2015-10-07 23:27:20

    都一样的,写法不同而已

CSS深入理解之float浮动

课程将会从感性的认识的角度讲解CSS float属性,浮动的前世今生

75964 学习 · 461 问题

查看课程

相似问题