Created
May 29, 2021 14:03
-
-
Save haroldao/6041c3ec790b4019d9cd9490c6642cc6 to your computer and use it in GitHub Desktop.
This file contains 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
// check device | |
let isMobile = false; | |
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { | |
isMobile = true; | |
document.body.classList.add('is-mobile'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment