blob: b23323ace2f51e160e8aacd38e619c1f0258661b [file] [log] [blame]
Dominique Hazael-Massieuxf69fc722013-05-30 12:31:401<!DOCTYPE html>
Zhiqiang Zhang2f202f42014-06-24 14:28:532<html>
Dominique Hazael-Massieuxf69fc722013-05-30 12:31:403 <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'/>
Zhiqiang Zhang2f202f42014-06-24 14:28:538 <meta name='flags' content='dom, interact'/>
Dominique Hazael-Massieuxf69fc722013-05-30 12:31:409 <meta name='assert' content='If the length of pattern is even, then remove the last entry in pattern.'/>
Dominique Hazael-Massieuxf69fc722013-05-30 12:31:4010 </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>
Dominique Hazael-Massieuxf69fc722013-05-30 12:31:4018 <script>
Dominique Hazael-Massieuxc3911b92014-03-10 11:05:2019 if (undefined !== navigator.vibrate) {
Dominique Hazael-Massieuxf69fc722013-05-30 12:31:4020 document.getElementById("vib").onclick = function () {
21 navigator.vibrate([1000, 1000, 1000, 1000, 1000, 1000]);
22 };
23 }
24 </script>
25 </body>
26</html>