npm install x-eqx Element Query.
``bash`
npm install --save x-eq
新添加了四个 element query: max-width, max-height, min-width, min-height
`css
div[max-width~=800px] {
/ ... /
}
div[max-width~=600px] {
/ ... /
}
`
* Basic | Online
* Custom | Online
属性的 stylesheet 也不会处理
API
$3
安装一个 key, fn 的参数是
(element, attribute);attribute 是一个 Object,包含下面几个属性
glue: 可以是
''、'=', '=', '^=', '$=', '~='
* value: 当只有属性名时,此值是 true,否则是指定的字符串
* numberValue: 如果 value 是个单位值,此值会将 value 转化成 px 单位,并只返回数字部分当 fn 返回
true`,表示需要添加此 attribute;否则删除此 attribute删除安装了的 key
当浏览器 resize 事件后,自动会执行 refresh;如果程序中有改变 DOM 大小,需要手动运行 refresh
如果禁用了自动运行,或者有新的 key install,或有旧的 key uninstall,都需要重新 run
Copyright (c) 2015 Zhonglei Qiu. Licensed under the MIT license.
[project-url]: https://github.com/qiu8310/x-eq
[git-tag-image]: http://img.shields.io/github/tag/qiu8310/x-eq.svg
[climate-url]: https://codeclimate.com/github/qiu8310/x-eq
[climate-image]: https://codeclimate.com/github/qiu8310/x-eq/badges/gpa.svg
[travis-url]: https://travis-ci.org/qiu8310/x-eq
[travis-image]: https://travis-ci.org/qiu8310/x-eq.svg?branch=master
[daviddm-url]: https://david-dm.org/qiu8310/x-eq.svg?theme=shields.io
[daviddm-image]: https://david-dm.org/qiu8310/x-eq
[coveralls-url]: https://coveralls.io/r/qiu8310/x-eq
[coveralls-image]: https://coveralls.io/repos/qiu8310/x-eq/badge.png