在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:WickyNilliams/enquire.js开源软件地址:https://github.com/WickyNilliams/enquire.js开源编程语言:JavaScript 85.3%开源软件介绍:enquire.js - Awesome Media Queries in JavaScript
Getting enquire.jsDownloadGet the latest build, ready to go:
Install via BowerTo install via bower, enter the following at the command line:
Install via npmTo install via npm, enter the following at the command line:
Build From SourceIf you want build from source (and run all unit tests etc):
Booya! Quick StartThe main method you will be dealing with is enquire.register(query /* string */, handler /* object || array || function */);
enquire.register("screen and (max-width:1000px)", {
match : function() {}, // OPTIONAL
// If supplied, triggered when the media query transitions
// *from an unmatched to a matched state*
unmatch : function() {}, // OPTIONAL
// If supplied, triggered when the media query transitions
// *from a matched state to an unmatched state*.
// Also may be called when handler is unregistered (if destroy is not available)
setup : function() {}, // OPTIONAL
// If supplied, triggered once immediately upon registration of the handler
destroy : function() {}, // OPTIONAL
// If supplied, triggered when handler is unregistered. Place cleanup code here
deferSetup : true // OPTIONAL, defaults to false
// If set to true, defers execution the setup function
// until the media query is first matched. still triggered just once
}); This should be enough to get you going, but please read the full enquire.js documentation if you wish to learn about the other cool features. Contributing
Then please don't hesitate to raise an issue, they will all be looked at and tended to. And for all the cool cats who are prepared to give their time to contribute code, feel free to open a pull request. If you could write unit tests to accompany your pull request that would be pretty sweet, but no worries if not - if it's good enough to be merged in, it's good enough for me to spend a little time to write tests on your behalf :-) LicenseLicense: MIT (http://www.opensource.org/licenses/mit-license.php) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论