robloach / jquery-once
仅对jQuery元素执行一次操作。
2.3.0
2024-01-04 22:13 UTC
Requires
- dev-master
- 2.3.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-beta.3
- 2.0.0-beta.2
- 2.0.0-beta.1
- 2.0.0-alpha.9
- 2.0.0-alpha.8
- 2.0.0-alpha.6
- 2.0.0-alpha.5
- 2.0.0-alpha.4
- 2.0.0-alpha.3
- 2.0.0-alpha.2
- 2.0.0-alpha.1
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.1
- 1.2.0
- dev-prepare-2.3.0
- dev-update-dev-deps
- dev-docs-david-greenkeeper
- dev-workflows
- dev-greenkeeper/xo-0.29.0
- dev-greenkeeper/xo-0.28.3
- dev-greenkeeper/xo-0.28.2
- dev-greenkeeper/jsdom-16.2.2
- dev-greenkeeper/xo-0.28.0
- dev-greenkeeper/xo-0.27.2
- dev-greenkeeper/xo-pin-0.27.0
- dev-greenkeeper/xo-0.27.1
- dev-greenkeeper/xo-0.26.1
- dev-nodejstest
- dev-greenkeeper/xo-pin-0.25.4
- dev-greenkeeper/xo-0.26.0
- dev-coveralls
- dev-changelog-2.2.3
This package is auto-updated.
Last update: 2024-09-04 23:52:09 UTC
README
仅对jQuery元素执行一次操作。
过滤掉所有之前已应用相同过滤器的所有元素。它可以用来确保函数只对一个元素应用一次。
安装
用法
有关如何使用jQuery Once的更多信息,请参阅API文档。
// The following will change the color of each paragraph to red, just once // for the "changecolor" key. $('p').once('changecolor').css('color', 'red'); // .once() will return a set of elements that yet to have the once ID // associated with them. You can return to the original collection set by // using .end(). $('p') .once("changecolorblue") .css("color", "blue") .end() .css("color", "red"); // To execute a function on the once set, you can use jQuery's each(). $('div.calendar').once().each(function() { // Since there is no once ID provided here, the key will be "once". });
开发
- 确保您正在使用node >= 4node
node --version
- 通过npm安装依赖项
npm install
- 检查编码风格标准,并执行自动测试
npm test
- 使用以下命令构建
jquery.once.min.js
npm run build
- 更新API文档
npm run docs
git add -A
git commit -m "2.3.0"
git tag 2.3.0
git push origin 2.3.0
npm publish
变更日志
许可协议
双重许可协议下
版权所有 © Rob Loach