pattern-array-manual.html (807B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset='utf-8'/> 5 <title>Vibration API: test a pattern array parameter to vibrate()</title> 6 <link rel='author' title='Robin Berjon' href='mailto:robin@berjon.com'/> 7 <link rel='help' href='http://www.w3.org/TR/vibration/#methods'/> 8 <meta name='flags' content='dom, interact'/> 9 </head> 10 <body> 11 <h1>Description</h1> 12 <p> 13 After hitting the button below, your device must vibrate three times for one second, separated 14 by one second intervals. 15 </p> 16 <button id='vib'>Vibrate!</button> 17 <script> 18 if (undefined !== navigator.vibrate) { 19 document.getElementById("vib").onclick = function () { 20 navigator.vibrate([1000, 1000, 1000, 1000, 1000]); 21 }; 22 } 23 </script> 24 </body> 25 </html>