pattern-array-extra-manual.html (948B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset='utf-8'/> 5 <title>Vibration API: test a pattern array parameter to vibrate() with an extra (even) item</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 <meta name='assert' content='If the length of pattern is even, then remove the last entry in pattern.'/> 10 </head> 11 <body> 12 <h1>Description</h1> 13 <p> 14 After hitting the button below, your device must vibrate three times for one second, separated 15 by one second intervals. 16 </p> 17 <button id='vib'>Vibrate!</button> 18 <script> 19 if (undefined !== navigator.vibrate) { 20 document.getElementById("vib").onclick = function () { 21 navigator.vibrate([1000, 1000, 1000, 1000, 1000, 1000]); 22 }; 23 } 24 </script> 25 </body> 26 </html>