简体   繁体   中英

Do I still have to manually include matchmedia.js and respond.js with modernizr?

The question is basically in the title: will the modernizr build tool include respond.js and/or matchmedia.js when I select media queries to be included (under extra)?

Or do I have to include it manually with Modernizr.load? (I've looked at the source, but I can't really tell whether respond.js is in there)

If you select the "Media Queries" option under "Extra" in the build tool, your Modernizr build will include a matchmedia.js-like function called Modernizr.mq() (see the documentation ). The code's basically the same as matchmedia as both were written by Paul Irish .

Respond.js isn't included in Modernizr, but Initializr can create an HTML5 Boilerplate build which includes Modernizr and Respond.js.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM