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
75b6bcdb
Commit
75b6bcdb
authored
Jan 10, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support .css("left",30). Fixed up the multiFilter code.
parent
f2ff0db0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
jquery.js
src/jquery/jquery.js
+18
-6
selector.js
src/selector/selector.js
+2
-7
No files found.
src/jquery/jquery.js
View file @
75b6bcdb
...
@@ -432,7 +432,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -432,7 +432,7 @@ jQuery.fn = jQuery.prototype = {
for
(
var
prop
in
obj
)
for
(
var
prop
in
obj
)
jQuery
.
attr
(
jQuery
.
attr
(
type
?
this
.
style
:
this
,
type
?
this
.
style
:
this
,
prop
,
jQuery
.
prop
(
this
,
obj
[
prop
])
prop
,
jQuery
.
prop
(
this
,
obj
[
prop
]
,
type
)
);
);
});
});
},
},
...
@@ -477,16 +477,22 @@ jQuery.fn = jQuery.prototype = {
...
@@ -477,16 +477,22 @@ jQuery.fn = jQuery.prototype = {
/**
/**
* Set a single style property to a value, on all matched elements.
* Set a single style property to a value, on all matched elements.
* If a number is provided, it is automatically converted into a pixel value.
*
*
* @example $("p").css("color","red");
* @example $("p").css("color","red");
* @before <p>Test Paragraph.</p>
* @before <p>Test Paragraph.</p>
* @result <p style="color:red;">Test Paragraph.</p>
* @result <p style="color:red;">Test Paragraph.</p>
* @desc Changes the color of all paragraphs to red
* @desc Changes the color of all paragraphs to red
*
*
* @example $("p").css("left",30);
* @before <p>Test Paragraph.</p>
* @result <p style="left:30px;">Test Paragraph.</p>
* @desc Changes the left of all paragraphs to "30px"
*
* @name css
* @name css
* @type jQuery
* @type jQuery
* @param String key The name of the property to set.
* @param String key The name of the property to set.
* @param
Object
value The value to set the property to.
* @param
String|Number
value The value to set the property to.
* @cat CSS
* @cat CSS
*/
*/
css
:
function
(
key
,
value
)
{
css
:
function
(
key
,
value
)
{
...
@@ -1236,10 +1242,16 @@ jQuery.extend({
...
@@ -1236,10 +1242,16 @@ jQuery.extend({
return
obj
;
return
obj
;
},
},
prop
:
function
(
elem
,
value
){
prop
:
function
(
elem
,
value
,
type
){
// Handle executable functions
// Handle executable functions
return
value
.
constructor
==
Function
&&
if
(
value
.
constructor
==
Function
)
value
.
call
(
elem
)
||
value
;
return
value
.
call
(
elem
)
// Handle passing in a number to a CSS property
if
(
value
.
constructor
==
Number
&&
type
==
"css"
)
return
value
+
"px"
;
return
value
;
},
},
className
:
{
className
:
{
...
...
src/selector/selector.js
View file @
75b6bcdb
...
@@ -93,16 +93,11 @@ jQuery.extend({
...
@@ -93,16 +93,11 @@ jQuery.extend({
var
old
,
cur
=
[];
var
old
,
cur
=
[];
while
(
expr
&&
expr
!=
old
)
{
while
(
expr
&&
expr
!=
old
)
{
console
.
log
(
cur
,
expr
,
elems
,
not
)
;
old
=
expr
;
var
f
=
jQuery
.
filter
(
expr
,
elems
,
not
);
var
f
=
jQuery
.
filter
(
expr
,
elems
,
not
);
expr
=
f
.
t
.
replace
(
/^
\s
*,
\s
*/
,
""
);
expr
=
f
.
t
.
replace
(
/^
\s
*,
\s
*/
,
""
);
cur
=
not
?
elems
=
f
.
r
:
jQuery
.
merge
(
cur
,
f
.
r
);
if
(
not
)
cur
=
elems
=
f
.
r
;
else
cur
=
jQuery
.
merge
(
cur
,
f
.
r
);
}
}
console
.
log
(
"DONE"
,
cur
,
expr
,
elems
,
not
);
return
cur
;
return
cur
;
},
},
...
...
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