Fixed a bug in .dir() where it would return non-element nodes.

This commit is contained in:
John Resig 2007-09-10 00:00:30 +00:00
parent f38251b2ce
commit 899ee03d37

View file

@ -404,7 +404,8 @@ jQuery.extend({
var matched = []; var matched = [];
var cur = elem[dir]; var cur = elem[dir];
while ( cur && cur != document ) { while ( cur && cur != document ) {
matched.push( cur ); if ( cur.nodeType == 1 )
matched.push( cur );
cur = cur[dir]; cur = cur[dir];
} }
return matched; return matched;