You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.0 KiB

!function(a){"use strict";var b=function(b,c,d){function m(a,b){return k&&(k=clearTimeout(k)),j=0,d?d.call(a,b):null}function n(a){e=a.clientX,f=a.clientY}function o(a,b){if(k&&(k=clearTimeout(k)),Math.abs(g-e)+Math.abs(h-f)<l.sensitivity)return j=1,c?c.call(a,b):null;g=e,h=f,k=setTimeout(function(){o(a,b)},l.interval)}function p(a){return k&&(k=clearTimeout(k)),b.removeEventListener("mousemove",n),1!==j&&(g=a.clientX,h=a.clientY,b.addEventListener("mousemove",n),k=setTimeout(function(){o(b,a)},l.interval)),this}function q(a){return k&&(k=clearTimeout(k)),b.removeEventListener("mousemove",n),1===j&&(k=setTimeout(function(){m(b,a)},l.timeout)),this}var e,f,g,h,i={},j=0,k=0,l={sensitivity:7,interval:100,timeout:0};return i.options=function(b){return l=a.extend({},l,b),i},i.remove=function(){b.removeEventListener("mouseover",p),b.removeEventListener("mouseout",q)},b.addEventListener("mouseover",p),b.addEventListener("mouseout",q),i};a.fn.hoverIntent=function(a,c,d){return this.each(function(){b(this,a,c).options(d||{})})}}(jQuery);