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
e755c194
Commit
e755c194
authored
Sep 15, 2012
by
Richard Gibson
Committed by
Dave Methvin
Sep 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12447: Ensure starting-point calc takes finite time. Close gh-922.
parent
560c178c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
effects.js
src/effects.js
+7
-8
No files found.
src/effects.js
View file @
e755c194
...
@@ -5,12 +5,13 @@ var fxNow, timerId,
...
@@ -5,12 +5,13 @@ var fxNow, timerId,
animationPrefilters
=
[
defaultPrefilter
],
animationPrefilters
=
[
defaultPrefilter
],
tweeners
=
{
tweeners
=
{
"*"
:
[
function
(
prop
,
value
)
{
"*"
:
[
function
(
prop
,
value
)
{
var
end
,
unit
,
prevScale
,
var
end
,
unit
,
tween
=
this
.
createTween
(
prop
,
value
),
tween
=
this
.
createTween
(
prop
,
value
),
parts
=
rfxnum
.
exec
(
value
),
parts
=
rfxnum
.
exec
(
value
),
target
=
tween
.
cur
(),
target
=
tween
.
cur
(),
start
=
+
target
||
0
,
start
=
+
target
||
0
,
scale
=
1
;
scale
=
1
,
maxIterations
=
20
;
if
(
parts
)
{
if
(
parts
)
{
end
=
+
parts
[
2
];
end
=
+
parts
[
2
];
...
@@ -26,17 +27,15 @@ var fxNow, timerId,
...
@@ -26,17 +27,15 @@ var fxNow, timerId,
do
{
do
{
// If previous iteration zeroed out, double until we get *something*
// If previous iteration zeroed out, double until we get *something*
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
prevScale
=
scale
=
scale
||
".5"
;
scale
=
scale
||
".5"
;
// Adjust and apply
// Adjust and apply
start
=
start
/
scale
;
start
=
start
/
scale
;
jQuery
.
style
(
tween
.
elem
,
prop
,
start
+
unit
);
jQuery
.
style
(
tween
.
elem
,
prop
,
start
+
unit
);
// Update scale, tolerating zeroes from tween.cur()
// Update scale, tolerating zero or NaN from tween.cur()
scale
=
tween
.
cur
()
/
target
;
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
}
while
(
scale
!==
(
scale
=
tween
.
cur
()
/
target
)
&&
scale
!==
1
&&
--
maxIterations
);
// Stop looping if we've hit the mark or scale is unchanged
}
while
(
scale
!==
1
&&
scale
!==
prevScale
);
}
}
tween
.
unit
=
unit
;
tween
.
unit
=
unit
;
...
...
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