Created
February 18, 2013 17:59
-
-
Save caycefischer/4979278 to your computer and use it in GitHub Desktop.
Check with js is a media query fired
src: http://bricss.net/post/22198838298/easily-checking-in-javascript-if-a-css-media-query-has
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
<style> | |
@media (min-width: 45em) { | |
body:after { | |
content: 'widescreen'; | |
display: none; | |
} | |
} | |
</style> | |
<script> | |
var size = window.getComputedStyle(document.body,':after').getPropertyValue('content'); | |
if (size == 'widescreen') { | |
// go nuts | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment