Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
a782afdf
Commit
a782afdf
authored
Feb 27, 2007
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported wiki changes from
http://docs.jquery.com/API/1.1.1/DOM/Traversing
parent
6850c4b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
12 deletions
+50
-12
jquery.js
src/jquery/jquery.js
+50
-12
No files found.
src/jquery/jquery.js
View file @
a782afdf
...
...
@@ -768,12 +768,37 @@ jQuery.fn = jQuery.prototype = {
},
/**
* End the most recent 'destructive' operation, reverting the list of matched elements
* back to its previous state. After an end operation, the list of matched elements will
* revert to the last state of matched elements.
* Revert the most recent 'destructive' operation, changing the set of matched elements
* to its previous state (right before the destructive operation).
*
* If there was no destructive operation before, an empty set is returned.
*
* A 'destructive' operation is any operation that changes the set of
* matched jQuery elements. These functions are:
* These functions are:
*
* <code>add</code>
*
* <code>children</code>
*
* <code>clone</code>
*
* <code>filter</code>
*
* <code>find</code>
*
* <code>not</code>
*
* <code>next</code>
*
* <code>parent</code>
*
* <code>parents</code>
*
* <code>prev</code>
*
* <code>siblings</code>
*
* @example $("p").find("span").end();
* @before <p><span>Hello</span>, how are you?</p>
* @result [ <p>...</p> ]
...
...
@@ -924,6 +949,13 @@ jQuery.fn = jQuery.prototype = {
* of matched elements. This method is used to remove one or more
* elements from a jQuery object.
*
* Please note: the expression cannot use a reference to the
* element name. See the two examples below.
*
* This will not work: $(".res img").not("img[@src$=on]")
*
* This will: $(".res img").not("[@src$=on]"); // also could be written $(".res img:not([@src$=on])")
*
* @example $("p").not( $("div p.selected") )
* @before <div><p>Hello</p><p class="selected">Hello Again</p></div>
* @result [ <p>Hello</p> ]
...
...
@@ -952,8 +984,12 @@ jQuery.fn = jQuery.prototype = {
* to the set of matched elements.
*
* @example $("p").add("span")
* @before <p>Hello</p><span>Hello Again</span>
* @result [ <p>Hello</p>, <span>Hello Again</span> ]
* @before (HTML) <p>Hello</p><span>Hello Again</span>
* @result (jQuery object matching 2 elements) [ <p>Hello</p>, <span>Hello Again</span> ]
* @desc Compare the above result to the result of <code>$('p')</code>,
* which would just result in <code><nowiki>[ <p>Hello</p> ]</nowiki></code>.
* Using add(), matched elements of <code>$('span')</code> are simply
* added to the returned jQuery-object.
*
* @name add
* @type jQuery
...
...
@@ -1783,7 +1819,7 @@ new function() {
* Get a set of elements containing the unique parents of the matched
* set of elements.
*
*
Can be filtered with an optional expressions
.
*
You may use an optional expression to filter the set of parent elements that will match
.
*
* @example $("p").parent()
* @before <div><p>Hello</p><p>Hello</p></div>
...
...
@@ -1805,7 +1841,7 @@ new function() {
* Get a set of elements containing the unique ancestors of the matched
* set of elements (except for the root element).
*
*
Can be filtered with an optional expressions
.
*
The matched elements can be filtered with an optional expression
.
*
* @example $("span").parents()
* @before <html><body><div><p><span>Hello</span></p><span>Hello Again</span></div></body></html>
...
...
@@ -1827,9 +1863,10 @@ new function() {
* Get a set of elements containing the unique next siblings of each of the
* matched set of elements.
*
* It only returns the very next sibling, not all next siblings.
* It only returns the very next sibling for each element, not all
* next siblings.
*
*
Can be filtered with an optional expressions
.
*
You may provide an optional expression to filter the match
.
*
* @example $("p").next()
* @before <p>Hello</p><p>Hello Again</p><div><span>And Again</span></div>
...
...
@@ -1851,9 +1888,9 @@ new function() {
* Get a set of elements containing the unique previous siblings of each of the
* matched set of elements.
*
*
Can be filtered with an optional expressions
.
*
Use an optional expression to filter the matched set
.
*
*
It only returns the immediately previous sibling
, not all previous siblings.
*
Only the immediately previous sibling is returned
, not all previous siblings.
*
* @example $("p").prev()
* @before <p>Hello</p><div><span>Hello Again</span></div><p>And Again</p>
...
...
@@ -1897,7 +1934,8 @@ new function() {
* Get a set of elements containing all of the unique children of each of the
* matched set of elements.
*
* Can be filtered with an optional expressions.
* This set can be filtered with an optional expression that will cause
* only elements matching the selector to be collected.
*
* @example $("div").children()
* @before <p>Hello</p><div><span>Hello Again</span></div><p>And Again</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment