Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

best way to detect mobile device jquery

$(function() {      
    let isMobile = window.matchMedia("only screen and (max-width: 760px)").matches;

    if (isMobile) {
        //Conditional script here
    }
 });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #detect #mobile #device #jquery
ADD COMMENT
Topic
Name
7+4 =