承接 robloach/jquery-once 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

robloach/jquery-once

最新稳定版本:2.3.0

Composer 安装命令:

composer require robloach/jquery-once

包简介

Act on jQuery elements only once.

README 文档

README

Testing NPM downloads

Act on jQuery elements only once.

Filters out all elements that had the same filter applied on them before. It can be used to ensure that a function is only applied once to an element.

Install

Method Installation
npm npm install jquery-once --save
Composer composer require robloach/jquery-once
Bower bower install jquery-once
Component component install RobLoach/jquery-once
jsDelivr //cdn.jsdelivr.net/npm/jquery-once@2.3.0/jquery.once.min.js
cdnjs //cdnjs.cloudflare.com/ajax/libs/jquery-once/2.3.0/jquery.once.js

Usage

See the API documentation for more information on how to use jQuery Once.

// 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".
});

Development

  1. Ensure you are using node >= 4:
node --version
  1. Install dependencies through npm:
npm install
  1. Check coding style standard, and automated testing:
npm test
  1. Build jquery.once.min.js with:
npm run build
  1. Update API documentation:
npm run docs
  1. Tag and publish the new versions to npm with Semantic Versioning:
git add -A
git commit -m "2.3.0"
git tag 2.3.0
git push origin 2.3.0
npm publish

Change Log

Discover the change history by heading on over to the CHANGELOG.md file.

License

Dual licensed under:

Copyright © Rob Loach

统计信息

  • 总下载量: 1.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 61
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 61
  • Watchers: 6
  • Forks: 20
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-04-05