From 5f026569668b1a84584ea79c1f6c967d26c1e482 Mon Sep 17 00:00:00 2001 From: "Liu, Xin" Date: Fri, 9 Aug 2013 15:34:00 +0800 Subject: [PATCH] improve accelerometer in behavior Signed-off-by: Liu, Xin --- tests/Accelerometer/index.html | 2 +- tests/Accelerometer/js/main.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Accelerometer/index.html b/tests/Accelerometer/index.html index f502645..1a0a0bf 100755 --- a/tests/Accelerometer/index.html +++ b/tests/Accelerometer/index.html @@ -63,7 +63,7 @@ Authors:
  • Y:
  • Z:
  • -

    X, Y, Z are always changing

    +

    X, Y, Z will be changed while moving the device, otherwise they will be zero

    diff --git a/tests/Accelerometer/js/main.js b/tests/Accelerometer/js/main.js index 6e68a8a..af52a3e 100755 --- a/tests/Accelerometer/js/main.js +++ b/tests/Accelerometer/js/main.js @@ -32,7 +32,7 @@ window.addEventListener( "devicemotion", function(evt) { var coordinate = evt.acceleration; - jQuery("#x").text("X: " + coordinate.x); - jQuery("#y").text("Y: " + coordinate.y); - jQuery("#z").text("Z: " + coordinate.z); + jQuery("#x").text("X: " + Math.round(coordinate.x-0)); + jQuery("#y").text("Y: " + Math.round(coordinate.y-0)); + jQuery("#z").text("Z: " + Math.round(coordinate.z-0)); }, false); -- 2.7.4