1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10(function($){ 11 /* hoverIntent by Brian Cherne */ 12 $.fn.hoverIntent = function(f,g) { 13 // default configuration options 14 var cfg = { 15 sensitivity: 7, 16 interval: 100, 17 timeout: 0 18 }; 19 // override configuration options with user supplied object 20 cfg = $.extend(cfg, g ? { over: f, out: g } : f ); 21 22 // instantiate variables 23 // cX, cY = current X and Y position of mouse, updated by mousemove event 24 // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval 25 var cX, cY, pX, pY; 26 27 // A private function for getting mouse position 28 var track = function(ev) { 29 cX = ev.pageX; 30 cY = ev.pageY; 31 }; 32 33 // A private function for comparing current and previous mouse position 34 var compare = function(ev,ob) { 35 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 36 // compare mouse positions to see if they've crossed the threshold 37 if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { 38 $(ob).unbind("mousemove",track); 39 // set hoverIntent state to true (so mouseOut can be called) 40 ob.hoverIntent_s = 1; 41 return cfg.over.apply(ob,[ev]); 42 } else { 43 // set previous coordinates for next time 44 pX = cX; pY = cY; 45 // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) 46 ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); 47 } 48 }; 49 50 // A private function for delaying the mouseOut function 51 var delay = function(ev,ob) { 52 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 53 ob.hoverIntent_s = 0; 54 return cfg.out.apply(ob,[ev]); 55 }; 56 57 // A private function for handling mouse 'hovering' 58 var handleHover = function(e) { 59 // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut 60 var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; 61 while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } } 62 if ( p == this ) { return false; } 63 64 // copy objects to be passed into t (required for event object to be passed in IE) 65 var ev = jQuery.extend({},e); 66 var ob = this; 67 68 // cancel hoverIntent timer if it exists 69 if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } 70 71 // else e.type == "onmouseover" 72 if (e.type == "mouseover") { 73 // set "previous" X and Y position based on initial entry point 74 pX = ev.pageX; pY = ev.pageY; 75 // update "current" X and Y position based on mousemove 76 $(ob).bind("mousemove",track); 77 // start polling interval (self-calling timeout) to compare mouse coordinates over time 78 if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} 79 80 // else e.type == "onmouseout" 81 } else { 82 // unbind expensive mousemove event 83 $(ob).unbind("mousemove",track); 84 // if hoverIntent state is true, then call the mouseOut function after the specified delay 85 if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} 86 } 87 }; 88 89 // bind the function to the two event listeners 90 return this.mouseover(handleHover).mouseout(handleHover); 91 }; 92 93})(jQuery); 94}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.