test whether a CSS media type or media query applies
// Likely want to requier both polyfills..;;
test 'tv' media type
if matches// tv media type supported
test a mobile device media query
if matches// smartphone/iphone... maybe run some small-screen related dom scripting?
test landscape orientation
if matches// probably tablet in widescreen view
How about resizing the browser?
His code: https://github.com/fofr/matchMedia.js -- though currently it doesnt support IE6-9, since they dont have transitions, obviously. :)
- Authors: Scott Jehl, Paul Irish, Nicholas Zakas
- Spec: dev.w3.org/csswg/cssom-view/#dom-window-matchmedia
- Native support: Chrome since m10, Firefox since 6, and Safari since 5.1