Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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>
Source by www.tutorialrepublic.com #
 
PREVIOUS NEXT
Tagged: #jquery #mobile #desktop
ADD COMMENT
Topic
Name
6+1 =