From ffb6d105e4f2a49ba7503634d853ce0317e37a8e Mon Sep 17 00:00:00 2001 From: llan Date: Fri, 20 Jan 2017 11:45:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 17e5265..9e810bc 100644 --- a/index.js +++ b/index.js @@ -418,7 +418,7 @@ class Block { } } /** - * init + * 初始化数据 */ const init = function (nextArr) { const BLOCK_SIZE = 20, @@ -441,7 +441,9 @@ const init = function (nextArr) { let block = new Block(params); block.init(); }; - +/** + * 浏览器加载初始化 + */ window.onload = function () { const site = document.querySelector('.site'); let {width, height, top, left} = window.getComputedStyle(site);