Accelerometer1
var Accelerometer = function() { | |
... | |
if (!!window.DeviceMotionEvent) { | |
window.addEventListener("devicemotion", handleMotion, true); | |
self.supported = true; | |
} | |
if (!!window.DeviceOrientationEvent) { | |
window.addEventListener("deviceorientation", handleOrientation, true); | |
self.supported = true; | |
} | |
window.addEventListener("compassneedscalibration", function(event) { | |
self.supported = true; | |
alert('Your compass needs calibrating!'); | |
event.preventDefault(); | |
}, true); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment