| Dominique Hazael-Massieux | f69fc72 | 2013-05-30 12:31:40 | [diff] [blame] | 1 | <!DOCTYPE html> |
| Zhiqiang Zhang | 2f202f4 | 2014-06-24 14:28:53 | [diff] [blame] | 2 | <html> |
| Dominique Hazael-Massieux | f69fc72 | 2013-05-30 12:31:40 | [diff] [blame] | 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'/> |
| Zhiqiang Zhang | 2f202f4 | 2014-06-24 14:28:53 | [diff] [blame] | 8 | <meta name='flags' content='dom, interact'/> |
| Dominique Hazael-Massieux | f69fc72 | 2013-05-30 12:31:40 | [diff] [blame] | 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> |
| Dominique Hazael-Massieux | f69fc72 | 2013-05-30 12:31:40 | [diff] [blame] | 17 | <script> |
| Dominique Hazael-Massieux | c3911b9 | 2014-03-10 11:05:20 | [diff] [blame] | 18 | if (undefined !== navigator.vibrate) { |
| Dominique Hazael-Massieux | f69fc72 | 2013-05-30 12:31:40 | [diff] [blame] | 19 | document.getElementById("vib").onclick = function () { |
| 20 | navigator.vibrate([1000, 1000, 1000, 1000, 1000]); |
| 21 | }; |
| 22 | } |
| 23 | </script> |
| 24 | </body> |
| 25 | </html> |