Greasy Fork is available in English.

jquery-tools

jquery工具

Ce script ne doit pas être installé directement. C'est une librairie destinée à être incluse dans d'autres scripts avec la méta-directive // @require https://update.greasyfork.org/scripts/441806/1030355/jquery-tools.js

$.fn.wait = function (func, interval) {
  var _interval = interval | 20,
    _self = this,
    _selector = this.selector,
    _iIntervalID;
  if (this.length) {
    func && func.call(this);
    clearInterval(_iIntervalID);
  } else {
    _iIntervalID = setInterval(function () {
      _self = $(_selector);
      if (_self.length) {
        func && func.call(_self);
        clearInterval(_iIntervalID);
      }
    }, _interval);
  }
  return this;
};