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
192bab8e
Commit
192bab8e
authored
Sep 17, 2010
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jQuery.css() returns a string value - handle this properly in the animation code.
parent
d1f3dc9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
effects.js
src/effects.js
+1
-1
effects.js
test/unit/effects.js
+6
-7
No files found.
src/effects.js
View file @
192bab8e
...
@@ -321,7 +321,7 @@ jQuery.fx.prototype = {
...
@@ -321,7 +321,7 @@ jQuery.fx.prototype = {
return
this
.
elem
[
this
.
prop
];
return
this
.
elem
[
this
.
prop
];
}
}
var
r
=
jQuery
.
css
(
this
.
elem
,
this
.
prop
);
var
r
=
parseFloat
(
jQuery
.
css
(
this
.
elem
,
this
.
prop
),
10
);
return
r
&&
r
>
-
10000
?
r
:
0
;
return
r
&&
r
>
-
10000
?
r
:
0
;
},
},
...
...
test/unit/effects.js
View file @
192bab8e
...
@@ -240,11 +240,11 @@ test("stop()", function() {
...
@@ -240,11 +240,11 @@ test("stop()", function() {
$foo
.
animate
({
width
:
'show'
},
1000
);
$foo
.
animate
({
width
:
'show'
},
1000
);
setTimeout
(
function
(){
setTimeout
(
function
(){
var
nw
=
$foo
.
width
();
var
nw
=
$foo
.
width
();
ok
(
nw
!=
w
,
"An animation occurred "
+
nw
+
"px "
+
w
+
"px"
);
notEqual
(
nw
,
w
,
"An animation occurred "
+
nw
+
"px "
+
w
+
"px"
);
$foo
.
stop
();
$foo
.
stop
();
nw
=
$foo
.
width
();
nw
=
$foo
.
width
();
ok
(
nw
!=
w
,
"Stop didn't reset the animation "
+
nw
+
"px "
+
w
+
"px"
);
notEqual
(
nw
,
w
,
"Stop didn't reset the animation "
+
nw
+
"px "
+
w
+
"px"
);
setTimeout
(
function
(){
setTimeout
(
function
(){
equals
(
nw
,
$foo
.
width
(),
"The animation didn't continue"
);
equals
(
nw
,
$foo
.
width
(),
"The animation didn't continue"
);
start
();
start
();
...
@@ -266,13 +266,12 @@ test("stop() - several in queue", function() {
...
@@ -266,13 +266,12 @@ test("stop() - several in queue", function() {
setTimeout
(
function
(){
setTimeout
(
function
(){
equals
(
$foo
.
queue
().
length
,
3
,
"All 3 still in the queue"
);
equals
(
$foo
.
queue
().
length
,
3
,
"All 3 still in the queue"
);
var
nw
=
$foo
.
width
();
var
nw
=
$foo
.
width
();
ok
(
nw
!=
w
,
"An animation occurred "
+
nw
+
"px "
+
w
+
"px"
);
notEqual
(
nw
,
w
,
"An animation occurred "
+
nw
+
"px "
+
w
+
"px"
);
$foo
.
stop
();
$foo
.
stop
();
nw
=
$foo
.
width
();
nw
=
$foo
.
width
();
ok
(
nw
!=
w
,
"Stop didn't reset the animation "
+
nw
+
"px "
+
w
+
"px"
);
notEqual
(
nw
,
w
,
"Stop didn't reset the animation "
+
nw
+
"px "
+
w
+
"px"
);
// Disabled, being flaky
//equals( $foo.queue().length, 1, "The next animation continued" );
$foo
.
stop
(
true
);
$foo
.
stop
(
true
);
start
();
start
();
},
100
);
},
100
);
...
@@ -517,7 +516,7 @@ jQuery.each( {
...
@@ -517,7 +516,7 @@ jQuery.each( {
if
(
t_h
==
"show"
)
{
if
(
t_h
==
"show"
)
{
var
old_h
=
jQuery
.
css
(
this
,
"height"
);
var
old_h
=
jQuery
.
css
(
this
,
"height"
);
jQuery
(
this
).
append
(
"<br/>Some more text<br/>and some more..."
);
jQuery
(
this
).
append
(
"<br/>Some more text<br/>and some more..."
);
notEqual
(
jQuery
.
css
(
this
,
"height"
),
old_h
,
"Make sure height is auto."
);
notEqual
(
jQuery
.
css
(
this
,
"height"
)
+
"px"
,
old_h
,
"Make sure height is auto."
);
}
}
start
();
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