jquery工具
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @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;
};