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
94fc6aac
Commit
94fc6aac
authored
Aug 25, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a fix for the Safari computedStyle bug.
parent
90647880
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
12 deletions
+26
-12
jquery.js
src/jquery/jquery.js
+26
-12
No files found.
src/jquery/jquery.js
View file @
94fc6aac
...
...
@@ -949,21 +949,35 @@ jQuery.extend({
return
jQuery
.
curCSS
(
e
,
p
);
},
curCSS
:
function
(
e
,
p
,
force
)
{
var
r
;
if
(
!
force
&&
e
.
style
[
p
])
r
=
e
.
style
[
p
];
else
if
(
e
.
currentStyle
)
{
var
np
=
p
.
replace
(
/
\-(\w)
/g
,
function
(
m
,
c
){
return
c
.
toUpperCase
()});
r
=
e
.
currentStyle
[
p
]
||
e
.
currentStyle
[
np
];
curCSS
:
function
(
elem
,
prop
,
force
)
{
var
ret
;
if
(
!
force
&&
elem
.
style
[
prop
])
{
ret
=
elem
.
style
[
prop
];
}
else
if
(
elem
.
currentStyle
)
{
var
newProp
=
prop
.
replace
(
/
\-(\w)
/g
,
function
(
m
,
c
){
return
c
.
toUpperCase
()});
ret
=
elem
.
currentStyle
[
prop
]
||
elem
.
currentStyle
[
np
];
}
else
if
(
document
.
defaultView
&&
document
.
defaultView
.
getComputedStyle
)
{
p
=
p
.
replace
(
/
([
A-Z
])
/g
,
"-$1"
).
toLowerCase
();
var
s
=
document
.
defaultView
.
getComputedStyle
(
e
,
""
);
r
=
s
?
s
.
getPropertyValue
(
p
)
:
null
;
prop
=
prop
.
replace
(
/
([
A-Z
])
/g
,
"-$1"
).
toLowerCase
();
var
cur
=
document
.
defaultView
.
getComputedStyle
(
elem
,
null
);
if
(
cur
)
ret
=
cur
.
getPropertyValue
(
prop
);
else
if
(
prop
==
'display'
)
ret
=
'none'
;
else
jQuery
.
swap
(
elem
,
{
display
:
'block'
},
function
()
{
ret
=
document
.
defaultView
.
getComputedStyle
(
this
,
null
).
getPropertyValue
(
prop
);
});
}
return
r
;
return
r
et
;
},
clean
:
function
(
a
)
{
...
...
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