This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license - IE8 VERSION! */ | |
window.matchMedia = window.matchMedia || (function(doc, undefined){ | |
var docElem = doc.documentElement, | |
refNode = docElem.firstElementChild || docElem.firstChild, | |
// fakeBody required for <FF4 when executed in <head> | |
fakeBody = doc.createElement('body'), | |
div = doc.createElement('div'); | |
div.id = 'mq-test-1'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ | |
window.matchMedia || (window.matchMedia = function() { | |
"use strict"; | |
// For browsers that support matchMedium api such as IE 9 and webkit | |
var styleMedia = (window.styleMedia || window.media); | |
// For those that don't support matchMedium | |
if (!styleMedia) { | |
var style = document.createElement('style'), |