Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery mobile or desktop

<script>
$(document).ready(function(){
    if (window.matchMedia('(max-width: 767px)').matches) {
      // The viewport is less than 768 pixels wide
      alert('This is a mobile device.');
    } else {
      // The viewport is at least 768 pixels wide
      alert('This is a tablet or desktop.');
    }
});
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: flatten array recursively 
Javascript :: react-native safeareaview 
Javascript :: get data attribute javascript 
Javascript :: get the most recent records in mongoose 
Javascript :: react antd form disable submit button 
Javascript :: for in react 
Javascript :: as it does not contain a package.json file. react 
Javascript :: how to search for a voice channel within a guild using discord.js 
Javascript :: angular disable click 
Javascript :: Add an element to an array at a specific index with JavaScript 
Javascript :: js list pf objects 
Javascript :: diagonal Difference in 2D arrays javascript 
Javascript :: javascript multidimensional array foreach 
Javascript :: node main 
Javascript :: play sound with keydown javascript 
Javascript :: javascript remove space 
Javascript :: how to export a variable in javascript 
Javascript :: sequelize sqlite example 
Javascript :: Bots member count discord js 
Javascript :: join method javascript 
Javascript :: store input into array javascript 
Javascript :: reset form jquery | form reset javascript/jquery 
Javascript :: tolocalestring javascript currency fixing 2 decimal places 
Javascript :: accessing object properties with bracket notation 
Javascript :: select in react js 
Javascript :: make multiple array in one array 
Javascript :: kebab case javascript 
Javascript :: if between two numbers javascript 
Javascript :: run function then empty it javascript 
Javascript :: double click in js 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =