Skip to content

Instantly share code, notes, and snippets.

@JimboFromLimbo
Created June 30, 2016 01:44
Show Gist options
  • Save JimboFromLimbo/a99ff6cf747b1a602bca7ff7d5a84acc to your computer and use it in GitHub Desktop.
Save JimboFromLimbo/a99ff6cf747b1a602bca7ff7d5a84acc to your computer and use it in GitHub Desktop.
var mediaQueryList = window.matchMedia('print');
var mqlScreen = window.matchMedia("screen")
mediaQueryList.addListener(function(mql) {
if (mql.matches) {
console.log('js you want to apply before print');
}
else if (mqlScreen.matches) {
console.log('js you want to apply after print');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment