icve-helper

icve-funs

目前為 2020-03-31 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/399050/786184/icve-helper.js

// ==UserScript==
// @name         	icve-helper
// @namespace    	[email protected]
// @version      	1.0.0
// @description  	icve-funs
// @author       	AI_童话
// ==/UserScript==



function hello(){
    console.log("hello world");
 }

 function getjQuery(window){
    window.jQuery.fn.wait = function (func, times, interval) {
		var _times = times || -1, //100次
			_interval = interval || 20, //20毫秒每次
			_self = this,
			_selector = this.selector, //选择器
			_iIntervalID; //定时器id
		if (this.length) { //如果已经获取到了,就直接执行函数
			func && func.call(this);
		} else {
			_iIntervalID = setInterval(function () {
				if (!_times) { //是0就退出
					clearInterval(_iIntervalID);
				}
				_times <= 0 || _times--; //如果是正数就 --

				_self = $(_selector); //再次选择
				if (_self.length) { //判断是否取到
					func && func.call(_self);
					clearInterval(_iIntervalID);
				}
			}, _interval);
		}
		return this;
    }
    return window.jQuery;
 }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址