Added .prevAll() and .nextAll() functionality.
This commit is contained in:
parent
b59c94d5c2
commit
052aa1445a
|
@ -1014,9 +1014,11 @@ jQuery.extend({
|
||||||
|
|
||||||
jQuery.each({
|
jQuery.each({
|
||||||
parent: "a.parentNode",
|
parent: "a.parentNode",
|
||||||
parents: "jQuery.parents(a)",
|
parents: "jQuery.dir(a,'parentNode')",
|
||||||
next: "jQuery.nth(a,2,'nextSibling')",
|
next: "jQuery.nth(a,2,'nextSibling')",
|
||||||
prev: "jQuery.nth(a,2,'previousSibling')",
|
prev: "jQuery.nth(a,2,'previousSibling')",
|
||||||
|
nextAll: "jQuery.dir(a,'nextSibling')",
|
||||||
|
prevtAll: "jQuery.dir(a,'previousSibling')",
|
||||||
siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
|
siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
|
||||||
children: "jQuery.sibling(a.firstChild)",
|
children: "jQuery.sibling(a.firstChild)",
|
||||||
contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
|
contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
|
||||||
|
|
|
@ -400,12 +400,12 @@ jQuery.extend({
|
||||||
return { r: r, t: t };
|
return { r: r, t: t };
|
||||||
},
|
},
|
||||||
|
|
||||||
parents: function( elem ){
|
dir: function( elem, dir ){
|
||||||
var matched = [];
|
var matched = [];
|
||||||
var cur = elem.parentNode;
|
var cur = elem[dir];
|
||||||
while ( cur && cur != document ) {
|
while ( cur && cur != document ) {
|
||||||
matched.push( cur );
|
matched.push( cur );
|
||||||
cur = cur.parentNode;
|
cur = cur[dir];
|
||||||
}
|
}
|
||||||
return matched;
|
return matched;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue