鼠标划过列表改变背景颜色的方法里有点疑问,为什么要用this,不可以用as[i],this不就是as[i]吗
for (var i = 0, len = as.length; i < len; i++) { as[i].onmouseover = function (i) { this.style.background = '#666'; }; as[i].onmouseout = function (i) { this.style.background = '#fff'; };
for (var i = 0, len = as.length; i < len; i++) { as[i].onmouseover = function (i) { this.style.background = '#666'; }; as[i].onmouseout = function (i) { this.style.background = '#fff'; };
2016-08-04
举报