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
3d1c27d5
Commit
3d1c27d5
authored
May 03, 2011
by
Daniel Pihlstrom
Committed by
timmywil
May 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix per-property easing. Fixes #9067
parent
31268449
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
effects.js
src/effects.js
+6
-3
effects.js
test/unit/effects.js
+12
-4
No files found.
src/effects.js
View file @
3d1c27d5
...
@@ -191,9 +191,12 @@ jQuery.fn.extend({
...
@@ -191,9 +191,12 @@ jQuery.fn.extend({
}
}
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
opt
.
animatedProperties
[
name
]
=
jQuery
.
isArray
(
val
)
?
if
(
jQuery
.
isArray
(
val
))
{
val
[
1
]:
opt
.
animatedProperties
[
name
]
=
val
[
1
];
opt
.
specialEasing
&&
opt
.
specialEasing
[
name
]
||
opt
.
easing
||
'swing'
;
prop
[
name
]
=
val
[
0
];
}
else
{
opt
.
animatedProperties
[
name
]
=
easing
||
opt
.
specialEasing
&&
opt
.
specialEasing
[
name
]
||
opt
.
easing
||
'swing'
;
}
}
}
if
(
opt
.
overflow
!=
null
)
{
if
(
opt
.
overflow
!=
null
)
{
...
...
test/unit/effects.js
View file @
3d1c27d5
...
@@ -923,9 +923,10 @@ test("jQuery.show('fast') doesn't clear radio buttons (bug #1095)", function ()
...
@@ -923,9 +923,10 @@ test("jQuery.show('fast') doesn't clear radio buttons (bug #1095)", function ()
test
(
"animate with per-property easing"
,
function
(){
test
(
"animate with per-property easing"
,
function
(){
expect
(
3
);
expect
(
5
);
stop
();
stop
();
var
data
=
{
a
:
0
,
b
:
0
,
c
:
0
};
var
_test1_called
=
false
;
var
_test1_called
=
false
;
var
_test2_called
=
false
;
var
_test2_called
=
false
;
var
_default_test_called
=
false
;
var
_default_test_called
=
false
;
...
@@ -934,23 +935,30 @@ test("animate with per-property easing", function(){
...
@@ -934,23 +935,30 @@ test("animate with per-property easing", function(){
_test1_called
=
true
;
_test1_called
=
true
;
};
};
jQuery
.
easing
[
"_test2"
]
=
function
()
{
jQuery
.
easing
[
"_test2"
]
=
function
(
p
)
{
_test2_called
=
true
;
_test2_called
=
true
;
return
p
;
};
};
jQuery
.
easing
[
"_default_test"
]
=
function
()
{
jQuery
.
easing
[
"_default_test"
]
=
function
(
p
)
{
_default_test_called
=
true
;
_default_test_called
=
true
;
return
p
;
};
};
jQuery
(
{
a
:
0
,
b
:
0
,
c
:
0
}
).
animate
({
jQuery
(
data
).
animate
({
a
:
[
100
,
"_test1"
],
a
:
[
100
,
"_test1"
],
b
:
[
100
,
"_test2"
],
b
:
[
100
,
"_test2"
],
c
:
100
c
:
100
},
400
,
"_default_test"
,
function
(){
},
400
,
"_default_test"
,
function
(){
start
();
start
();
ok
(
_test1_called
,
"Easing function (1) called"
);
ok
(
_test1_called
,
"Easing function (1) called"
);
ok
(
_test2_called
,
"Easing function (2) called"
);
ok
(
_test2_called
,
"Easing function (2) called"
);
ok
(
data
.
b
==
100
,
"Easing function (2) assigned correct value"
);
ok
(
_default_test_called
,
"Easing function (_default) called"
);
ok
(
_default_test_called
,
"Easing function (_default) called"
);
ok
(
data
.
c
==
100
,
"Easing function (_default) assigned correct value"
);
});
});
});
});
...
...
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