编辑:hoverIntent.js
/*! * hoverIntent v1.10.2 // 2020.04.28 // jQuery v1.7.0+ * http://briancherne.github.io/jquery-hoverIntent/ * * You may use hoverIntent under the terms of the MIT license. Basically that * means you are free to use hoverIntent as long as this header is left intact. * Copyright 2007-2019 Brian Cherne */ /** * hoverIntent is similar to jQuery's built-in "hover" method except that * instead of firing the handlerIn function immediately, hoverIntent checks * to see if the user's mouse has slowed down (beneath the sensitivity * threshold) before firing the event. The handlerOut function is only * called after a matching handlerIn. * * // basic usage ... just like .hover() * .hoverIntent( handlerIn, handlerOut ) * .hoverIntent( handlerInOut ) * * // basic usage ... with event delegation! * .hoverIntent( handlerIn, handlerOut, selector ) * .hoverIntent( handlerInOut, selector ) * * // using a basic configuration object * .hoverIntent( config ) * * @param handlerIn function OR configuration object * @param handlerOut function OR selector for delegation OR undefined * @param selector selector OR undefined * @author Brian Cherne <brian(at)cherne(dot)net> */ ;(function(factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { module.exports = factory(require('jquery')); } else if (jQuery && !jQuery.fn.hoverIntent) { factory(jQuery); } })(function($) { 'use strict'; // default configuration values var _cfg = { interval: 100, sensitivity: 6, timeout: 0 }; // counter used to generate an ID for each instance var INSTANCE_COUNT = 0; // current X and Y position of mouse, updated during mousemove tracking (shared across instances) var cX, cY; // saves the current pointer position coordinates based on the given mousemove event var track = function(ev) { cX = ev.pageX; cY = ev.pageY; }; // compares current and previous mouse positions var compare = function(ev,$el,s,cfg) { // compare mouse positions to see if pointer has slowed enough to trigger `over` function if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) { $el.off(s.event,track); delete s.timeoutId; // set hoverIntent state as active for this element (permits `out` handler to trigger) s.isActive = true; // overwrite old mouseenter event coordinates with most recent pointer position ev.pageX = cX; ev.pageY = cY; // clear coordinate data from state object delete s.pX; delete s.pY; return cfg.over.apply($el[0],[ev]); } else { // set previous coordinates for next comparison s.pX = cX; s.pY = cY; // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval ); } }; // triggers given `out` function at configured `timeout` after a mouseleave and clears state var delay = function(ev,$el,s,out) { var data = $el.data('hoverIntent'); if (data) { delete data[s.id]; } return out.apply($el[0],[ev]); }; // checks if `value` is a function var isFunction = function(value) { return typeof value === 'function'; }; $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { // instance ID, used as a key to store and retrieve state information on an element var instanceId = INSTANCE_COUNT++; // extend the default configuration and parse parameters var cfg = $.extend({}, _cfg); if ( $.isPlainObject(handlerIn) ) { cfg = $.extend(cfg, handlerIn); if ( !isFunction(cfg.out) ) { cfg.out = cfg.over; } } else if ( isFunction(handlerOut) ) { cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); } else { cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); } // A private function for handling mouse 'hovering' var handleHover = function(e) { // cloned event to pass to handlers (copy required for event object to be passed in IE) var ev = $.extend({},e); // the current target of the mouse event, wrapped in a jQuery object var $el = $(this); // read hoverIntent data from element (or initialize if not present) var hoverIntentData = $el.data('hoverIntent'); if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); } // read per-instance state from element (or initialize if not present) var state = hoverIntentData[instanceId]; if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; } // state properties: // id = instance ID, used to clean up data // timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler // isActive = plugin state, true after `over` is called just until `out` is called // pX, pY = previously-measured pointer coordinates, updated at each polling interval // event = string representing the namespaced event used for mouse tracking // clear any existing timeout if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); } // namespaced event used to register and unregister mousemove tracking var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId; // handle the event, based on its type if (e.type === 'mouseenter') { // do nothing if already active if (state.isActive) { return; } // set "previous" X and Y position based on initial entry point state.pX = ev.pageX; state.pY = ev.pageY; // update "current" X and Y position based on mousemove $el.off(mousemove,track).on(mousemove,track); // start polling interval (self-calling timeout) to compare mouse coordinates over time state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval ); } else { // "mouseleave" // do nothing if not already active if (!state.isActive) { return; } // unbind expensive mousemove event $el.off(mousemove,track); // if hoverIntent state is true, then call the mouseOut function after the specified delay state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout ); } }; // listen for mouseenter and mouseleave return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); }; });
保存文件
位置:
home
/
fembzvrs
/
zimeza.com
/
wp-includes
/
js
批量上传
创建
创建
批量权限
批量删除
名称
权限
大小
修改时间
操作
↑ 返回上级
-
-
-
-
codemirror
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
crop
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
dist
drwxr-xr-x
-
2025-12-03 02:17
权限
删除
重命名
imgareaselect
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
jcrop
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
jquery
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
mediaelement
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
plupload
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
swfupload
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
thickbox
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
tinymce
drwxr-xr-x
-
2025-07-06 02:11
权限
删除
重命名
api-request.min.js
-rw-r--r--
1023 B
2025-02-06 22:27
编辑
下载
权限
删除
重命名
autosave.js
-rw-r--r--
21.95 KB
2025-01-24 04:54
编辑
下载
权限
删除
重命名
customize-preview-nav-menus.js
-rw-r--r--
14.67 KB
2020-07-28 03:35
编辑
下载
权限
删除
重命名
customize-views.min.js
-rw-r--r--
2.51 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
hoverIntent.js
-rw-r--r--
7.06 KB
2022-01-03 20:03
编辑
下载
权限
删除
重命名
mce-view.js
-rw-r--r--
25.24 KB
2023-10-10 01:31
编辑
下载
权限
删除
重命名
mce-view.min.js
-rw-r--r--
9.54 KB
2025-02-06 22:27
编辑
下载
权限
删除
重命名
media-editor.min.js
-rw-r--r--
10.63 KB
2025-02-06 22:27
编辑
下载
权限
删除
重命名
media-models.js
-rw-r--r--
42.58 KB
2025-03-04 19:55
编辑
下载
权限
删除
重命名
media-views.min.js
-rw-r--r--
108.18 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
quicktags.js
-rw-r--r--
22.07 KB
2021-09-09 03:29
编辑
下载
权限
删除
重命名
quicktags.min.js
-rw-r--r--
10.87 KB
2025-02-06 22:27
编辑
下载
权限
删除
重命名
shortcode.min.js
-rw-r--r--
2.58 KB
2022-09-23 23:55
编辑
下载
权限
删除
重命名
tw-sack.js
-rw-r--r--
4.85 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
twemoji.js
-rw-r--r--
36.32 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
underscore.js
-rw-r--r--
67.12 KB
2024-08-11 03:57
编辑
下载
权限
删除
重命名
wp-auth-check.min.js
-rw-r--r--
1.62 KB
2025-02-06 22:27
编辑
下载
权限
删除
重命名
wp-embed.js
-rw-r--r--
3.14 KB
2023-08-10 23:49
编辑
下载
权限
删除
重命名
wp-emoji-loader.js
-rw-r--r--
12.89 KB
2025-12-03 02:17
编辑
下载
权限
删除
重命名
wp-lists.min.js
-rw-r--r--
7.34 KB
2025-02-06 22:27
编辑
下载
权限
删除
重命名
wp-pointer.min.js
-rw-r--r--
3.54 KB
2025-02-06 22:27
编辑
下载
权限
删除
重命名
wp-sanitize.min.js
-rw-r--r--
444 B
2025-12-03 02:17
编辑
下载
权限
删除
重命名
wpdialog.min.js
-rw-r--r--
281 B
2025-02-06 22:27
编辑
下载
权限
删除
重命名
wplink.js
-rw-r--r--
20.74 KB
2025-01-24 04:54
编辑
下载
权限
删除
重命名
zxcvbn.min.js
-rw-r--r--
802.97 KB
2019-10-26 04:17
编辑
下载
权限
删除
重命名