Question : detect mobile device
Answered by : john-michael-belmonte
$(function() { let isMobile = window.matchMedia("only screen and (max-width: 760px)").matches; if (isMobile) { //Conditional script here } });
Source : https://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device | Last Update : Mon, 02 May 22
Question : how to detect device javascirpt
Answered by : nutty-newt-3630j4ewyjtn
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { // some code..
}
Source : https://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device | Last Update : Thu, 09 Jul 20
Question : Check for mobile device
Answered by : confused-civet-5fxj1uglcu3f
const isMobile = window.matchMedia("only screen and (max-width: 760px)").matches;if (isMobile) { //...}
Source : https://javascript.plainenglish.io/how-to-detect-a-mobile-device-with-javascript-1c26e0002b31 | Last Update : Thu, 09 Sep 21