Created
July 25, 2011 08:12
-
-
Save kennyadsl/1103747 to your computer and use it in GitHub Desktop.
Check mediaquery with jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.matchMedia('only screen and (max-device-width: 480px)').matches) { | |
// Asynchronously load iphone.js | |
} else if (window.matchMedia('only screen and (min-device-width: 481px) and ' + | |
'(max-device-width: 1024px) and ' + | |
'(orientation: portrait)').matches) { | |
// Asynchronously load ipad-portrait.js | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment