Created
October 5, 2022 21:21
-
-
Save ZhouYang1993/f6de44819fcd88c16ca0890f617dbdaa to your computer and use it in GitHub Desktop.
Detect Devices in JavaScripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onClick(){ | |
if(window.screen.width>=600){ | |
// do sth for desktop browsers | |
} | |
else{ | |
// do sth for mobile browsers | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment