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
c5edf982
Commit
c5edf982
authored
Feb 13, 2011
by
Anton M
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't add "px" to unit-less properties when animating them. Fixes #4966.
parent
dba8c20b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
effects.js
src/effects.js
+2
-2
effects.js
test/unit/effects.js
+10
-0
No files found.
src/effects.js
View file @
c5edf982
...
@@ -189,7 +189,7 @@ jQuery.fn.extend({
...
@@ -189,7 +189,7 @@ jQuery.fn.extend({
if
(
parts
)
{
if
(
parts
)
{
var
end
=
parseFloat
(
parts
[
2
]
),
var
end
=
parseFloat
(
parts
[
2
]
),
unit
=
parts
[
3
]
||
"px"
;
unit
=
parts
[
3
]
||
jQuery
.
cssNumber
[
name
]
?
""
:
"px"
;
// We need to compute starting value
// We need to compute starting value
if
(
unit
!==
"px"
)
{
if
(
unit
!==
"px"
)
{
...
@@ -348,7 +348,7 @@ jQuery.fx.prototype = {
...
@@ -348,7 +348,7 @@ jQuery.fx.prototype = {
this
.
startTime
=
jQuery
.
now
();
this
.
startTime
=
jQuery
.
now
();
this
.
start
=
from
;
this
.
start
=
from
;
this
.
end
=
to
;
this
.
end
=
to
;
this
.
unit
=
unit
||
this
.
unit
||
"px"
;
this
.
unit
=
unit
||
this
.
unit
||
jQuery
.
cssNumber
[
this
.
prop
]
?
""
:
"px"
;
this
.
now
=
this
.
start
;
this
.
now
=
this
.
start
;
this
.
pos
=
this
.
state
=
0
;
this
.
pos
=
this
.
state
=
0
;
...
...
test/unit/effects.js
View file @
c5edf982
...
@@ -919,3 +919,13 @@ test("hide hidden elements, with animation (bug #7141)", function() {
...
@@ -919,3 +919,13 @@ test("hide hidden elements, with animation (bug #7141)", function() {
});
});
});
});
});
});
test
(
"animate unit-less properties (#4966)"
,
2
,
function
()
{
stop
();
var
div
=
jQuery
(
"<div style='z-index: 0'></div>"
).
appendTo
(
"body"
);
equal
(
div
.
css
(
"z-index"
),
"0"
,
"z-index is 0"
);
div
.
animate
({
zIndex
:
2
},
function
()
{
equal
(
div
.
css
(
"z-index"
),
"2"
,
"z-index is 2"
);
start
();
});
});
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