Search

8/27/2008

isAncestor

http://developer.yahoo.com/yui/docs/YAHOO.util.Dom.html#method_isAncestor - 可以取代掉 jquery 的 withinElement

isAncestor
Boolean isAncestor ( haystack , needle )
Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy.

Parameters:
haystack The possible ancestor
needle The possible descendent

Returns: Boolean
Whether or not the haystack is an ancestor of needle

沒有留言: