From 03b9ca36c4becd5304b4ec9628521f4081963d69 Mon Sep 17 00:00:00 2001 From: llan Date: Mon, 23 Jan 2017 11:55:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88preventdefault?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- first-step/index.js | 1 - second-step/index.js | 1 - 2 files changed, 2 deletions(-) diff --git a/first-step/index.js b/first-step/index.js index c6fd0b7..fe66d08 100644 --- a/first-step/index.js +++ b/first-step/index.js @@ -10,7 +10,6 @@ class Block { */ move() { document.onkeydown = (e)=> { - e.preventDefault(); let activeModel = document.querySelector('.activityModel'), left = parseInt(activeModel.style.left) ? parseInt(activeModel.style.left) : 0, top = parseInt(activeModel.style.top) ? parseInt(activeModel.style.top) : 0; diff --git a/second-step/index.js b/second-step/index.js index e5544c1..b817531 100644 --- a/second-step/index.js +++ b/second-step/index.js @@ -46,7 +46,6 @@ class Block { */ move() { document.onkeydown = (e)=> { - e.preventDefault(); let activeModel = document.querySelector('.activityModel'), left = parseInt(activeModel.style.left) ? parseInt(activeModel.style.left) : 0, top = parseInt(activeModel.style.top) ? parseInt(activeModel.style.top) : 0;