var columns = Array.from(document.getElementsByClassName('column'));function padClock(p, n){ return p + ('0' + n).slice(-2); } function getClock(){ var d = new Date(); return [d.getHours(), d.getMinutes(), d.getSeconds()].reduce(padClock); } var loop = setInterval(function (){ var c = getClock(); columns.forEach(function (ele,i){ var n =+c[i]; //这里的=+我改成+=或n=n+c[i]都无效,还有下面的=- var offset =-n * 86; });},1000);
添加回答
举报
0/150
提交
取消