diff options
author | John Resig <jeresig@gmail.com> | 2007-09-09 21:34:37 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2007-09-09 21:34:37 +0000 |
commit | 052aa1445a780f69576a800836be73b57b62a909 (patch) | |
tree | ad66b47a39eb323618361df3e2ddae54b51c9ea2 /src | |
parent | b59c94d5c23c0b1ec4b2506be0aed6b0578f19f3 (diff) | |
download | jquery-052aa1445a780f69576a800836be73b57b62a909.tar.gz jquery-052aa1445a780f69576a800836be73b57b62a909.zip |
Added .prevAll() and .nextAll() functionality.
Diffstat (limited to 'src')
-rw-r--r-- | src/core.js | 4 | ||||
-rw-r--r-- | src/selector.js | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core.js b/src/core.js index 67cb147c7..bedafdce2 100644 --- a/src/core.js +++ b/src/core.js @@ -1014,9 +1014,11 @@ jQuery.extend({ jQuery.each({ parent: "a.parentNode", - parents: "jQuery.parents(a)", + parents: "jQuery.dir(a,'parentNode')", next: "jQuery.nth(a,2,'nextSibling')", prev: "jQuery.nth(a,2,'previousSibling')", + nextAll: "jQuery.dir(a,'nextSibling')", + prevtAll: "jQuery.dir(a,'previousSibling')", siblings: "jQuery.sibling(a.parentNode.firstChild,a)", children: "jQuery.sibling(a.firstChild)", contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)" diff --git a/src/selector.js b/src/selector.js index 0dadeb453..1fbbe9be6 100644 --- a/src/selector.js +++ b/src/selector.js @@ -400,12 +400,12 @@ jQuery.extend({ 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; + cur = cur[dir]; } return matched; }, |