Question : best way to detect mobile device jquery
Answered by : expensive-emu-0xcru3sx0ln9
$(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 : Wed, 02 Dec 20
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