Loading js/jquery.hoverIntent.js +138 −125 Original line number Diff line number Diff line ;/*! * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+ /*! * 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, 2014 Brian Cherne * Copyright 2007-2019 Brian Cherne */ /* hoverIntent is similar to jQuery's built-in "hover" method except that /** * 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 Loading @@ -28,10 +29,14 @@ * @param handlerOut function OR selector for delegation OR undefined * @param selector selector OR undefined * @author Brian Cherne <brian(at)cherne(dot)net> */(function (factory) { */ ;(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); } Loading Loading @@ -80,10 +85,18 @@ // triggers given `out` function at configured `timeout` after a mouseleave and clears state var delay = function(ev,$el,s,out) { delete $el.data('hoverIntent')[s.id]; 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++; Loading @@ -92,10 +105,10 @@ var cfg = $.extend({}, _cfg); if ( $.isPlainObject(handlerIn) ) { cfg = $.extend(cfg, handlerIn); if (!typeof cfg.out === 'function') { if ( !isFunction(cfg.out) ) { cfg.out = cfg.over; } } else if (typeof handlerOut === 'function') { } else if ( isFunction(handlerOut) ) { cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); } else { cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); Loading Loading
js/jquery.hoverIntent.js +138 −125 Original line number Diff line number Diff line ;/*! * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+ /*! * 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, 2014 Brian Cherne * Copyright 2007-2019 Brian Cherne */ /* hoverIntent is similar to jQuery's built-in "hover" method except that /** * 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 Loading @@ -28,10 +29,14 @@ * @param handlerOut function OR selector for delegation OR undefined * @param selector selector OR undefined * @author Brian Cherne <brian(at)cherne(dot)net> */(function (factory) { */ ;(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); } Loading Loading @@ -80,10 +85,18 @@ // triggers given `out` function at configured `timeout` after a mouseleave and clears state var delay = function(ev,$el,s,out) { delete $el.data('hoverIntent')[s.id]; 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++; Loading @@ -92,10 +105,10 @@ var cfg = $.extend({}, _cfg); if ( $.isPlainObject(handlerIn) ) { cfg = $.extend(cfg, handlerIn); if (!typeof cfg.out === 'function') { if ( !isFunction(cfg.out) ) { cfg.out = cfg.over; } } else if (typeof handlerOut === 'function') { } else if ( isFunction(handlerOut) ) { cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); } else { cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); Loading