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
6541eb9d
Commit
6541eb9d
authored
Sep 17, 2010
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up some un-needed CSS code and adding back a temporary (deprecated) curCSS method.
parent
51d25807
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
css.js
src/css.js
+8
-7
dimensions.js
src/dimensions.js
+2
-2
No files found.
src/css.js
View file @
6541eb9d
...
...
@@ -21,7 +21,9 @@ var ralpha = /alpha\([^)]*\)/,
jQuery
.
fn
.
css
=
function
(
name
,
value
)
{
return
jQuery
.
access
(
this
,
name
,
value
,
true
,
function
(
elem
,
name
,
value
)
{
return
jQuery
.
css
(
elem
,
name
,
value
);
return
value
!==
undefined
?
jQuery
.
style
(
elem
,
name
,
value
)
:
jQuery
.
css
(
elem
,
name
);
});
};
...
...
@@ -90,19 +92,15 @@ jQuery.extend({
}
},
css
:
function
(
elem
,
name
,
value
,
extra
)
{
css
:
function
(
elem
,
name
,
extra
)
{
// Make sure that we're working with the right name
var
ret
,
origName
=
name
.
replace
(
rdashAlpha
,
fcamelCase
),
hooks
=
jQuery
.
cssHooks
[
origName
];
name
=
jQuery
.
cssProps
[
origName
]
||
origName
;
// Check if we're setting a value, just use jQuery.style (DEPRECATED)
if
(
value
!==
undefined
)
{
jQuery
.
style
(
elem
,
name
,
value
);
// If a hook was provided get the computed value from there
}
else
if
(
hooks
&&
"get"
in
hooks
&&
(
ret
=
hooks
.
get
(
elem
,
true
,
extra
))
!==
undefined
)
{
if
(
hooks
&&
"get"
in
hooks
&&
(
ret
=
hooks
.
get
(
elem
,
true
,
extra
))
!==
undefined
)
{
return
ret
;
// Otherwise, if a way to get the computed value exists, use that
...
...
@@ -130,6 +128,9 @@ jQuery.extend({
}
});
// DEPRECATED, Use jQuery.css() instead
jQuery
.
curCSS
=
jQuery
.
css
;
jQuery
.
each
([
"height"
,
"width"
],
function
(
i
,
name
)
{
jQuery
.
cssHooks
[
name
]
=
{
get
:
function
(
elem
,
computed
,
extra
)
{
...
...
src/dimensions.js
View file @
6541eb9d
...
...
@@ -8,14 +8,14 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
// innerHeight and innerWidth
jQuery
.
fn
[
"inner"
+
name
]
=
function
()
{
return
this
[
0
]
?
parseFloat
(
jQuery
.
css
(
this
[
0
],
type
,
undefined
,
"padding"
),
10
)
:
parseFloat
(
jQuery
.
css
(
this
[
0
],
type
,
"padding"
),
10
)
:
null
;
};
// outerHeight and outerWidth
jQuery
.
fn
[
"outer"
+
name
]
=
function
(
margin
)
{
return
this
[
0
]
?
parseFloat
(
jQuery
.
css
(
this
[
0
],
type
,
undefined
,
margin
?
"margin"
:
"border"
),
10
)
:
parseFloat
(
jQuery
.
css
(
this
[
0
],
type
,
margin
?
"margin"
:
"border"
),
10
)
:
null
;
};
...
...
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