问答详情
源自:5-2 float浮动去空格

js中for循环问题


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++么

提问者:22不小了 2015-10-07 23:23

个回答

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

    一样的意思 只是简写而已

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

    都一样的,写法不同而已