MCPcopy Index your code
hub / github.com/JsAaron/jQuery / withinElement

Function withinElement

1.2.6/src/event.js:587–594  ·  view source on GitHub ↗
(event, elem)

Source from the content-addressed store, hash-verified

585// Checks if an event happened on an element within another element
586// Used in jQuery.event.special.mouseenter and mouseleave handlers
587var withinElement = function(event, elem) {
588 // Check if mouse(over|out) are still within the same parent element
589 var parent = event.relatedTarget;
590 // Traverse up the tree
591 while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
592 // Return true if we actually just moused on to a sub-element
593 return parent == elem;
594};
595
596// Prevent memory leaks in IE
597// And prevent errors on refresh with events like mouseover in other browsers

Callers 1

event.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected