DEV Community

loading...
Cover image for How to vibrate with javascript + Pro tip

How to vibrate with javascript + Pro tip

raghav9official profile image Raghav Yadav Updated on ・1 min read

Alt Text

How to vibrate the JavaScript?
Though vibration can provide haptic feedback and a confirmation kinda thing which tells the user that an action has been performed.

That's easy use:

navigator.vibrate(200);
Enter fullscreen mode Exit fullscreen mode

Or use hash.js and use:

hash().vibrate(200) //where 200 is the strength
Enter fullscreen mode Exit fullscreen mode

Pro tip:
Use

hash().vibrate(200, 100, 50, 500, 90, 82);
Enter fullscreen mode Exit fullscreen mode

to vibrate in periods

Anddd if(article="nice"){
document.querySelector("#like_btn").click()
}
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

Forem Open with the Forem app