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
2a921daa
Commit
2a921daa
authored
Sep 01, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented some more functions.
parent
c8009abc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
3 deletions
+89
-3
jquery.js
src/jquery/jquery.js
+89
-3
No files found.
src/jquery/jquery.js
View file @
2a921daa
...
@@ -781,6 +781,21 @@ jQuery.fn = jQuery.prototype = {
...
@@ -781,6 +781,21 @@ jQuery.fn = jQuery.prototype = {
}),
arguments
);
}),
arguments
);
},
},
/**
* Create cloned copies of all matched DOM Elements. This does
* not create a cloned copy of this particular jQuery object,
* instead it creates duplicate copies of all DOM Elements.
* This is useful for moving copies of the elements to another
* location in the DOM.
*
* @example $("b").clone().prependTo("p");
* @before <b>Hello</b><p>, how are you?</p>
* @result <b>Hello</b><p><b>Hello</b>, how are you?</p>
*
* @name clone
* @type jQuery
* @cat DOM/Manipulation
*/
clone
:
function
(
deep
)
{
clone
:
function
(
deep
)
{
return
this
.
pushStack
(
jQuery
.
map
(
this
,
function
(
a
){
return
this
.
pushStack
(
jQuery
.
map
(
this
,
function
(
a
){
return
a
.
cloneNode
(
deep
!=
undefined
?
deep
:
true
);
return
a
.
cloneNode
(
deep
!=
undefined
?
deep
:
true
);
...
@@ -1502,7 +1517,8 @@ jQuery.extend({
...
@@ -1502,7 +1517,8 @@ jQuery.extend({
innerHTML
:
"innerHTML"
,
innerHTML
:
"innerHTML"
,
className
:
"className"
,
className
:
"className"
,
value
:
"value"
,
value
:
"value"
,
disabled
:
"disabled"
disabled
:
"disabled"
,
checked
:
"checked"
};
};
if
(
fix
[
name
]
)
{
if
(
fix
[
name
]
)
{
...
@@ -2175,8 +2191,8 @@ jQuery.macros = {
...
@@ -2175,8 +2191,8 @@ jQuery.macros = {
* Get the current CSS background of the first matched element.
* Get the current CSS background of the first matched element.
*
*
* @example $("p").background();
* @example $("p").background();
* @before <p>This is just a test.</p>
* @before <p
style="background:blue;"
>This is just a test.</p>
* @result ""
* @result "
blue
"
*
*
* @name background
* @name background
* @type String
* @type String
...
@@ -2197,6 +2213,64 @@ jQuery.macros = {
...
@@ -2197,6 +2213,64 @@ jQuery.macros = {
*/
*/
css
:
"width,height,top,left,position,float,overflow,color,background"
.
split
(
","
),
css
:
"width,height,top,left,position,float,overflow,color,background"
.
split
(
","
),
/**
* Reduce the set of matched elements to a single element.
* The position of the element in the set of matched elements
* starts at 0 and goes to length - 1.
*
* @example $("p").eq(1)
* @before <p>This is just a test.</p><p>So is this</p>
* @result [ <p>So is this</p> ]
*
* @name eq
* @type jQuery
* @param Number pos The index of the element that you wish to limit to.
* @cat Core
*/
/**
* Reduce the set of matched elements to all elements before a given position.
* The position of the element in the set of matched elements
* starts at 0 and goes to length - 1.
*
* @example $("p").lt(1)
* @before <p>This is just a test.</p><p>So is this</p>
* @result [ <p>This is just a test.</p> ]
*
* @name lt
* @type jQuery
* @param Number pos Reduce the set to all elements below this position.
* @cat Core
*/
/**
* Reduce the set of matched elements to all elements after a given position.
* The position of the element in the set of matched elements
* starts at 0 and goes to length - 1.
*
* @example $("p").gt(0)
* @before <p>This is just a test.</p><p>So is this</p>
* @result [ <p>So is this</p> ]
*
* @name gt
* @type jQuery
* @param Number pos Reduce the set to all elements after this position.
* @cat Core
*/
/**
* Filter the set of elements to those that contain the specified text.
*
* @example $("p").contains("test")
* @before <p>This is just a test.</p><p>So is this</p>
* @result [ <p>This is just a test.</p> ]
*
* @name contains
* @type jQuery
* @param String str The string that will be contained within the text of an element.
* @cat DOM/Traversing
*/
filter
:
[
"eq"
,
"lt"
,
"gt"
,
"contains"
],
filter
:
[
"eq"
,
"lt"
,
"gt"
,
"contains"
],
...
@@ -2627,6 +2701,18 @@ jQuery.macros = {
...
@@ -2627,6 +2701,18 @@ jQuery.macros = {
each
:
{
each
:
{
/**
* Remove an attribute from each of the matched elements.
*
* @example $("input").removeAttr("disabled")
* @before <input disabled="disabled"/>
* @result <input/>
*
* @name removeAttr
* @type jQuery
* @param String name The name of the attribute to remove.
* @cat DOM
*/
removeAttr
:
function
(
key
)
{
removeAttr
:
function
(
key
)
{
this
.
removeAttribute
(
key
);
this
.
removeAttribute
(
key
);
},
},
...
...
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