A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/apis/vibration below:

Vibration API ยท WebPlatform Docs

Vibration API Summary

The Vibration API provides access to the vibration mechanism of the hosting device. Vibration is a form of tactile feedback, often used by mobile phones.

Usage
 This API is specifically designed to address use cases that require simple tactile feedback only. This API is not meant to be used as a generic notification mechanism. Such use cases may be handled using the Web Notifications specification.

In the following example the device will vibrate for 1000 milliseconds (ms):

navigator.vibrate(1000);

navigator.vibrate([1000]);

In the following example the pattern will cause the device to vibrate for 50 ms, be still for 100 ms, and then vibrate for 150 ms:

navigator.vibrate([50, 100, 150]);

The following example cancels any existing vibrations:

navigator.vibrate(0);

navigator.vibrate([]);
See also Related articles Mobile External resources

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4