Forked from josetapadas/gist:f9eec8ca7d9f214f0918
Last active
August 29, 2015 14:28
-
-
Save alex-quiterio/c1642b78918da9479439 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