From 754437dd93e94b438886dc9087edbc3333ee2f94 Mon Sep 17 00:00:00 2001 From: llan Date: Thu, 19 Jan 2017 16:35:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=A5=E6=A0=BC=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F&&=E5=8E=BB=E9=99=A4argument=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.css | 1 + index.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.css b/index.css index 18f7e16..ce1f1ed 100644 --- a/index.css +++ b/index.css @@ -1,6 +1,7 @@ body { margin: 0; padding: 0; + background-color: rgb(246, 244, 236); } .site { diff --git a/index.js b/index.js index cd28afa..2ec869e 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ /** * Created by llan on 2017/1/11. */ +'use strict'; /** * 方块 * @param params @@ -240,14 +241,14 @@ const block = function (params) { * 方块自由下落 * @type {number} */ - const fallDown = setTimeout(function () { + const fallDown = setTimeout(function loop() { let moveDown = canMove(arr).canMoveDown; if (moveDown) { for (let v of activityModels) { v.style.top = `calc(${v.style.top} + ${BLOCK_SIZE}px)`; } curTop++; - setTimeout(arguments.callee, delay / window.__level__); + setTimeout(loop, delay / window.__level__); } else { for (let i = 0; i < activityModels.length; i++) { activityModels[i].className = 'inactiveModel'