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
77412e03
Commit
77412e03
authored
Aug 10, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for both .stop() tests to finish, don't count on timing.
parent
e4155395
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
effects.js
test/unit/effects.js
+13
-7
No files found.
test/unit/effects.js
View file @
77412e03
...
@@ -552,27 +552,30 @@ test("animate non-element", function() {
...
@@ -552,27 +552,30 @@ test("animate non-element", function() {
});
});
test
(
"stop()"
,
function
()
{
test
(
"stop()"
,
function
()
{
expect
(
4
);
expect
(
4
);
stop
();
stop
();
var
$foo
=
jQuery
(
"#foo"
);
var
$foo
=
jQuery
(
"#foo"
),
var
w
=
0
;
tests
=
2
,
w
=
0
;
$foo
.
hide
().
css
(
"width"
,
200
)
$foo
.
hide
().
css
(
"width"
,
200
)
.
animate
(
{
"width"
:
"show"
},
1
0
00
);
.
animate
(
{
"width"
:
"show"
},
1
5
00
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
nw
=
$foo
.
css
(
"width"
);
var
nw
=
$foo
.
css
(
"width"
);
notEqual
(
parseFloat
(
nw
),
w
,
"An animation occurred "
+
nw
+
" "
+
w
+
"px"
);
notEqual
(
parseFloat
(
nw
),
w
,
"An animation occurred "
+
nw
+
" "
+
w
+
"px"
);
$foo
.
stop
();
$foo
.
stop
();
nw
=
$foo
.
css
(
"width"
);
nw
=
$foo
.
css
(
"width"
);
notEqual
(
parseFloat
(
nw
),
w
,
"Stop didn't reset the animation "
+
nw
+
" "
+
w
+
"px"
);
notEqual
(
parseFloat
(
nw
),
w
,
"Stop didn't reset the animation "
+
nw
+
" "
+
w
+
"px"
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$foo
.
removeData
();
$foo
.
removeData
();
$foo
.
removeData
(
undefined
,
true
);
$foo
.
removeData
(
undefined
,
true
);
equal
(
nw
,
$foo
.
css
(
"width"
),
"The animation didn't continue"
);
equal
(
nw
,
$foo
.
css
(
"width"
),
"The animation didn't continue"
);
start
();
if
(
--
tests
===
0
)
{
start
();
}
},
100
);
},
100
);
},
100
);
},
100
);
...
@@ -586,6 +589,9 @@ test("stop()", function() {
...
@@ -586,6 +589,9 @@ test("stop()", function() {
equal
(
$two
.
css
(
"opacity"
),
"0"
,
"Stop does not interfere with animations on other elements (#6641)"
);
equal
(
$two
.
css
(
"opacity"
),
"0"
,
"Stop does not interfere with animations on other elements (#6641)"
);
// Reset styles
// Reset styles
$one
.
add
(
$two
).
css
(
"opacity"
,
""
);
$one
.
add
(
$two
).
css
(
"opacity"
,
""
);
if
(
--
tests
===
0
)
{
start
();
}
});
});
},
50
);
},
50
);
});
});
...
...
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