Skip to content

Instantly share code, notes, and snippets.

@jimkang
Created October 10, 2013 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimkang/6917993 to your computer and use it in GitHub Desktop.
Save jimkang/6917993 to your computer and use it in GitHub Desktop.
Running a CSS media query in JavaScript.
var isMobileMediaQuery = 'only screen and (max-device-height: 568px)';
if (window.matchMedia(isMobileMediaQuery).matches) {
transformString += ('rotate(' +
(textPaneIsHidden ? '90deg' : '-90deg') + ') ');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment