Created
February 28, 2014 07:59
-
-
Save bogomolov-dev/9267089 to your computer and use it in GitHub Desktop.
Vibration API - HTML5 APIs - http://www.starstormdesign.de/vibration-api-html5/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vibriere 300ms, mach 200ms Pause und vibriere anschließend 800ms. | |
navigator.vibrate([300, 200, 800]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vibration abbrechen | |
navigator.vibrate(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vibriere 1000ms | |
navigator.vibrate(1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; | |
if (navigator.vibrate) { | |
// API verfügbar | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment