The Vibration API is an API specifically made for mobile devices as they are thankfully the only devices that have a vibrate function. The API allows developers to vibrate a device (in a pattern) for a given duration.
This plugins allow you to use the API in an easy way together with jQuery.
$("#example-one .button").vibrate();
$("#example-two .button").vibrate("short");
var item = $("#example-three .button");
// Either of these
item.vibrate("medium");
item.vibrate("default");
item.vibrate(50);
$("#example-four .button").vibrate("long");
$("#example-five .button").vibrate({
duration: 2000,
trigger: "touchstart"
});
$("#example-six .button").vibrate({
pattern: [20, 200, 20]
});
$(".example-long .button").each(function() {
$(this).vibrate(parseInt($(this).text(), 10));
});
$("#example-checkbox .checkbox").vibrate({
pattern: [5, 200, 20]
});