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);
聪明的汤姆
相关分类