Modify ↓
Ticket #7157 (closed bug: fixed)
Animation callback shows element is still ":animated"
| Reported by: | Motty | Owned by: | gnarf |
|---|---|---|---|
| Priority: | low | Milestone: | 1.8 |
| Component: | effects | Version: | 1.4.2 |
| Keywords: | animation callback | Cc: | |
| Blocking: | Blocked by: |
Description
After an element has completed its animation, the callback still shows that the element is animated. I posted a demo here: http://jsfiddle.net/5V5M3/
$(".block").animate({
"left": "+=50px"
}, "slow", function() {
alert($(".block").is(':animated'));
});
I can hack around it by basically using a setTimeout:
$(".block").animate({
"left": "+=50px"
}, "slow", function() {
setTimeout(function() { alert($(".block").is(':animated')) }, 0);
});
Change History
comment:4 Changed 2 years ago by dmethvin
There is a test case in https://github.com/jquery/jquery/pull/273 that might be handy.
comment:5 Changed 2 years ago by timmywil
- Owner set to timmywil
- Priority changed from undecided to low
- Status changed from open to assigned
comment:8 Changed 13 months ago by Corey Frang
- Status changed from assigned to closed
- Resolution set to fixed
Fix #7157. Animation callbacks shouldn't see an element as :animated.
Unless of course, there are other animations to be done! Closes gh-775.
Changeset: 6bf3f20d4e0f69ab14702152880a0574623490e2
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
