diff --git a/Vibration/index.html b/Vibration/index.html index 00cb5bc..7dc067e 100644 --- a/Vibration/index.html +++ b/Vibration/index.html @@ -47,6 +47,19 @@ div.bb-docs { padding: 1rem; } + + @-moz-keyframes vibrate { + from { + -moz-transform: rotate(-2deg); + } + to { + -moz-transform: rotate(2deg); + } + } + + #vibrate.do { + -moz-animation: vibrate 10ms linear infinite alternate; + } @@ -76,11 +89,13 @@

Vibration API test app

intervalId = setInterval(function(){ window.navigator.vibrate(200); },200); + document.querySelector("#vibrate").className = 'do'; } function stopVibrate() { clearInterval(intervalId); window.navigator.vibrate(0); + document.querySelector("#vibrate").className = ''; } return {