Vibration API

September 4, 2015 in Firefox OS, Javascript, Programming, Tutorial by admin

Javascript128Via Mozilla Developer Network:
Vibration is described as a pattern of on-off pulses, which may be of varying lengths. The pattern may consist of either a single integer, describing the number of milliseconds to vibrate, or an array of integers describing a pattern of vibrations and pauses. Vibration is controlled with a single method: Navigator.vibrate().

Most modern mobile devices include vibration hardware, which lets software code provide physical feedback to the user by causing the device to shake. TheVibration API offers Web apps the ability to access this hardware, if it exists, and does nothing if the device doesn’t support it.

 

For the entire article, follow this link.