Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check if mobile view javascript

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

    if (isMobile) {
        //Conditional script here
    }
 });
Comment

PREVIOUS NEXT
Code Example
Javascript :: math.round js 1 decimal 
Javascript :: ionic 4 get previous route 
Javascript :: javascript disable context menu 
Javascript :: loop through json object javascript 
Javascript :: javascript remove dom element 
Javascript :: brackets not autocompleting in js file in vscode 
Javascript :: how to make an express server 
Javascript :: how to set text for label in jquery 
Javascript :: how to swap two elements in an array js 
Javascript :: firebase get current user javascript 
Javascript :: start peerjs server 
Javascript :: angular usehash not working 
Javascript :: angular int to string 
Javascript :: js get difference in days 
Javascript :: nods js fs append to file 
Javascript :: setlocalstorage 
Javascript :: how to use keytar electron 
Javascript :: js arrotondare numeri 
Javascript :: react router Link does work 
Javascript :: ReferenceError: window is not defined 
Javascript :: How to get unix timestamp from tomorrow nodejs 
Javascript :: regex for lowercase letters js 
Javascript :: useFetch custom hook for React 
Javascript :: toobject() javascript 
Javascript :: electron download 
Javascript :: jquery calc height based on width 
Javascript :: nuxt small scroll 
Javascript :: remove array empty values javascript 
Javascript :: jsx if block 
Javascript :: react-native curved view 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =