Skip to content

Instantly share code, notes, and snippets.

@jimkang
Created October 10, 2013 13:05
Show Gist options
  • Select an option

  • Save jimkang/6917993 to your computer and use it in GitHub Desktop.

Select an option

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