Created
July 25, 2014 14:57
-
-
Save josetapadas/f9eec8ca7d9f214f0918 to your computer and use it in GitHub Desktop.
Dynamic single shot media query
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
var mediaQueryListElement = window.matchMedia("all and (min-width: 666px)"); | |
function call_me(name) { | |
console.log("És um " + name); | |
mediaQueryListElement.removeListener(call_me.caller); | |
} | |
mediaQueryListElement.addListener(function() { | |
call_me("sugar"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment