HTMLify
js3.html
Views: 642 | Author: demo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <!DOCTYPE html> <html> <head> <title>Auto Vibration on Page Load</title> </head> <body> <script> // Function to trigger vibration on page load function autoVibrateOnLoad() { if ("vibrate" in navigator) { // Vibrate for 1000 milliseconds (1 second) when the page loads navigator.vibrate(1000); } else { console.log("Vibration API not supported"); } } // Attach the autoVibrateOnLoad function to the window's load event autoVibrateOnLoad() </script> </body> </html> |