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 : if mobile
Answered by : isaac-groisman-afzx9092x66j
function isMobile() { return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
}
Source : https://stackoverflow.com/questions/4117555/simplest-way-to-detect-a-mobile-device-in-php | Last Update : Wed, 10 Nov 21
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