Vibration API

The Vibration API provides a way to control the vibration mechanism of the hosting device.

Interactive Demo
Try out different vibration patterns and durations
Not Supported
ms
ms
ms
ms
ms
API Documentation
Reference guide for the Vibration API

Methods

  • navigator.vibrate(duration) - Vibrate for specified milliseconds
  • navigator.vibrate(pattern) - Vibrate following a pattern array

Parameters

  • duration - Number of milliseconds to vibrate
  • pattern - Array of numbers representing vibration and pause intervals