my.offDeviceMotionChange
Stop listening for device orientation change events.
Parameters
Type | Required | Description |
Function listener | Yes | The listener function that is passed to |
Sample Code
Remove a specific listener
copy
//Define the listener function.
var listener = function (res) {
console.log(res.alpha);
console.log(res.beta);
console.log(res.gamma);
}
//Listen for the device orientation change event.
my.onDeviceMotionChange(this.listener);
//Remove the listener.
my.offDeviceMotionChange(this.listener)
Remove all listeners
copy
my.offDeviceMotionChange()