matchMedia() polyfill
test whether a CSS media type or media query applies
Usage
require('matchmedia-polyfill');
require('matchmedia-polyfill/matchMedia.addListener');
test 'tv' media type
if (matchMedia('tv').matches) {
}
test a mobile device media query
if (matchMedia('only screen and (max-width: 480px)').matches) {
}
test landscape orientation
if (matchMedia('all and (orientation:landscape)').matches) {
}
Used in:
How about resizing the browser?
Paul Hayes tackled this using CSS transitions and their transitionEnd event
His code: https://github.com/fofr/matchMedia.js -- though currently it doesnt support IE6-9, since they dont have transitions, obviously. :)