I'm trying to figure out what the best way to get enquire.js to work on legacy browsers (ie 6-9). On enquire's site, it says to use modernizr to check for matchMedia support, then load a polyfill if it's not supported.
Modernizr.load([
//first test need for polyfill
{
test: window.matchMedia,
nope: "/path/to/polyfill.js"
},
//and then load enquire
"/path/to/enquire.js"
]);
Looking at the polyfill that it suggests, it says that modernizr already includes it with Modernizr.mq().
Used in:
Respond.js
FormFactor
Modernizr
https://github.com/paulirish/matchMedia.js/
I've looked into this, but can't find a way to make this work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…