return { r: r, t: t };
},
- parents: function( elem ){
+ dir: function( elem, dir ){
var matched = [];
- var cur = elem.parentNode;
+ var cur = elem[dir];
while ( cur && cur != document ) {
- matched.push( cur );
- cur = cur.parentNode;
+ if ( cur.nodeType == 1 )
+ matched.push( cur );
+ cur = cur[dir];
}
return matched;
},