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
0fea007a
Commit
0fea007a
authored
Aug 15, 2012
by
Corey Frang
Committed by
Dave Methvin
Aug 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12273. Don't call easing functions for duration 0 animations. Close gh-895.
parent
3812f943
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
effects.js
src/effects.js
+7
-1
effects.js
test/unit/effects.js
+18
-0
No files found.
src/effects.js
View file @
0fea007a
...
@@ -376,7 +376,13 @@ Tween.prototype = {
...
@@ -376,7 +376,13 @@ Tween.prototype = {
var
eased
,
var
eased
,
hooks
=
Tween
.
propHooks
[
this
.
prop
];
hooks
=
Tween
.
propHooks
[
this
.
prop
];
this
.
pos
=
eased
=
jQuery
.
easing
[
this
.
easing
](
percent
,
this
.
options
.
duration
*
percent
,
0
,
1
,
this
.
options
.
duration
);
if
(
this
.
options
.
duration
)
{
this
.
pos
=
eased
=
jQuery
.
easing
[
this
.
easing
](
percent
,
this
.
options
.
duration
*
percent
,
0
,
1
,
this
.
options
.
duration
);
}
else
{
this
.
pos
=
eased
=
percent
;
}
this
.
now
=
(
this
.
end
-
this
.
start
)
*
eased
+
this
.
start
;
this
.
now
=
(
this
.
end
-
this
.
start
)
*
eased
+
this
.
start
;
if
(
this
.
options
.
step
)
{
if
(
this
.
options
.
step
)
{
...
...
test/unit/effects.js
View file @
0fea007a
...
@@ -1811,4 +1811,22 @@ test( "Animate properly sets overflow hidden when animating width/height (#12117
...
@@ -1811,4 +1811,22 @@ test( "Animate properly sets overflow hidden when animating width/height (#12117
});
});
});
});
test
(
"Animations with 0 duration don't ease (#12273)"
,
1
,
function
()
{
jQuery
.
easing
.
test
=
function
()
{
ok
(
false
,
"Called easing"
);
};
jQuery
(
"#foo"
).
animate
({
height
:
100
},
{
duration
:
0
,
easing
:
"test"
,
complete
:
function
()
{
equal
(
jQuery
(
this
).
height
(),
100
,
"Height is 100"
);
}
});
delete
jQuery
.
easing
.
test
;
});
}
// if ( jQuery.fx )
}
// if ( jQuery.fx )
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