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
ec3ebd3e
Commit
ec3ebd3e
authored
May 14, 2009
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opacity is now retrieved from stylesheet in IE. fixes #3981
parent
b763cc66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
css.js
src/css.js
+9
-3
index.html
test/index.html
+3
-0
css.js
test/unit/css.js
+5
-1
No files found.
src/css.js
View file @
ec3ebd3e
...
@@ -120,12 +120,18 @@ jQuery.extend({
...
@@ -120,12 +120,18 @@ jQuery.extend({
},
},
curCSS
:
function
(
elem
,
name
,
force
)
{
curCSS
:
function
(
elem
,
name
,
force
)
{
var
ret
,
style
=
elem
.
style
;
var
ret
,
style
=
elem
.
style
,
filter
;
// IE uses filters for opacity
// IE uses filters for opacity
if
(
!
jQuery
.
support
.
opacity
&&
name
==
"opacity"
)
{
if
(
!
jQuery
.
support
.
opacity
&&
name
==
"opacity"
)
{
ret
=
style
.
filter
&&
style
.
filter
.
indexOf
(
"opacity="
)
>=
0
?
filter
=
(
filter
=
style
.
filter
)
&&
filter
.
indexOf
(
"opacity="
)
>=
0
?
(
parseFloat
(
style
.
filter
.
match
(
/opacity=
([^
)
]
*
)
/
)[
1
]
)
/
100
)
+
''
:
filter
:
(
filter
=
elem
.
currentStyle
[
'filter'
])
&&
filter
.
indexOf
(
"opacity="
)
>=
0
?
filter
:
null
;
ret
=
filter
&&
filter
.
indexOf
(
"opacity="
)
>=
0
?
(
parseFloat
(
filter
.
match
(
/opacity=
([^
)
]
*
)
/
)[
1
]
)
/
100
)
+
''
:
""
;
""
;
return
ret
===
""
?
return
ret
===
""
?
...
...
test/index.html
View file @
ec3ebd3e
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<title>
jQuery Test Suite
</title>
<title>
jQuery Test Suite
</title>
<link
rel=
"Stylesheet"
media=
"screen"
href=
"qunit/testsuite.css"
/>
<link
rel=
"Stylesheet"
media=
"screen"
href=
"qunit/testsuite.css"
/>
<style
type=
"text/css"
media=
"screen"
>
ol
#empty
{
opacity
:
0
;
filter
:
Alpha
(
opacity
=
0
);
}
/* for testing opacity set in styles in IE */
</style>
<!-- Includes -->
<!-- Includes -->
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
jQuery
=
this
.
jQuery
||
"jQuery"
,
// For testing .noConflict()
var
jQuery
=
this
.
jQuery
||
"jQuery"
,
// For testing .noConflict()
...
...
test/unit/css.js
View file @
ec3ebd3e
module
(
"css"
);
module
(
"css"
);
test
(
"css(String|Hash)"
,
function
()
{
test
(
"css(String|Hash)"
,
function
()
{
expect
(
2
1
);
expect
(
2
3
);
equals
(
jQuery
(
'#main'
).
css
(
"display"
),
'none'
,
'Check for css property "display"'
);
equals
(
jQuery
(
'#main'
).
css
(
"display"
),
'none'
,
'Check for css property "display"'
);
...
@@ -34,6 +34,10 @@ test("css(String|Hash)", function() {
...
@@ -34,6 +34,10 @@ test("css(String|Hash)", function() {
});
});
jQuery
(
'#foo'
).
css
({
opacity
:
''
});
jQuery
(
'#foo'
).
css
({
opacity
:
''
});
equals
(
jQuery
(
'#foo'
).
css
(
'opacity'
),
'1'
,
"Assert opacity is 1 when set to an empty String"
);
equals
(
jQuery
(
'#foo'
).
css
(
'opacity'
),
'1'
,
"Assert opacity is 1 when set to an empty String"
);
equals
(
jQuery
(
'#empty'
).
css
(
'opacity'
),
'0'
,
"Assert opacity is accessible via filter property set in stylesheet in IE"
);
jQuery
(
'#empty'
).
css
({
opacity
:
'1'
});
equals
(
jQuery
(
'#empty'
).
css
(
'opacity'
),
'1'
,
"Assert opacity is taken from style attribute when set vs stylesheet in IE with filters"
);
});
});
test
(
"css(String, Object)"
,
function
()
{
test
(
"css(String, Object)"
,
function
()
{
...
...
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