2016-05-07 50 views

回答

0

這是一種可以計算震動的方法。

shake.startWatch(onShake); 
var count = 0; 
function onShake() 
{ 
    alert('Shook'); 
    count++ //increases count by 1 each time the function is called. 
} 

// Stop watching for shaking event 
shake.stopWatch();