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
1e677f30
Commit
1e677f30
authored
Nov 07, 2011
by
timmywil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add back unit in the width/height step function. Fixes #10669.
parent
a7e911b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
effects.js
src/effects.js
+1
-1
effects.js
test/unit/effects.js
+15
-0
No files found.
src/effects.js
View file @
1e677f30
...
@@ -620,7 +620,7 @@ jQuery.extend( jQuery.fx, {
...
@@ -620,7 +620,7 @@ jQuery.extend( jQuery.fx, {
// Do not set anything below 0
// Do not set anything below 0
jQuery
.
each
([
"width"
,
"height"
],
function
(
i
,
prop
)
{
jQuery
.
each
([
"width"
,
"height"
],
function
(
i
,
prop
)
{
jQuery
.
fx
.
step
[
prop
]
=
function
(
fx
)
{
jQuery
.
fx
.
step
[
prop
]
=
function
(
fx
)
{
jQuery
.
style
(
fx
.
elem
,
prop
,
Math
.
max
(
0
,
fx
.
now
)
);
jQuery
.
style
(
fx
.
elem
,
prop
,
Math
.
max
(
0
,
fx
.
now
)
+
fx
.
unit
);
};
};
});
});
...
...
test/unit/effects.js
View file @
1e677f30
...
@@ -324,6 +324,21 @@ test("animate table-cell width/height", function() {
...
@@ -324,6 +324,21 @@ test("animate table-cell width/height", function() {
});
});
});
});
test
(
"animate percentage(%) on width/height"
,
function
()
{
expect
(
2
);
var
$div
=
jQuery
(
"<div style='position:absolute;top:-999px;left:-999px;width:60px;height:60px;'><div style='width:50%;height:50%;'></div></div>"
)
.
appendTo
(
"#qunit-fixture"
).
children
(
"div"
);
stop
();
$div
.
animate
({
width
:
"25%"
,
height
:
"25%"
},
13
,
function
()
{
var
$this
=
jQuery
(
this
);
equal
(
$this
.
width
(),
15
,
"Width was animated to 15px rather than 25px"
);
equal
(
$this
.
height
(),
15
,
"Height was animated to 15px rather than 25px"
);
start
();
});
});
test
(
"animate resets overflow-x and overflow-y when finished"
,
function
()
{
test
(
"animate resets overflow-x and overflow-y when finished"
,
function
()
{
expect
(
2
);
expect
(
2
);
stop
();
stop
();
...
...
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