Opened 11 years ago
Closed 11 years ago
#10364 closed bug (invalid)
Animate and stop on a object
Reported by: | anonymous | Owned by: | anonymous |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | effects | Version: | 1.6.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi,
I animate an object. When the animation finish, i stop all animations on this object (to be sure that no other animation are still running), and set an other animation on this object: it doesn't work.
A script example:
$(function($) { o={i:1} oW=$(o); oH=$(o); oW.animate({i:10},{duration:2000,complete:function(){ alert('first animate complete'); oW.stop(true); oW.animate({i:20},{duration:2000,complete:function(){ alert('second animate never complete') }}); }}); });
Change History (5)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | unfiled → effects |
---|---|
Owner: | set to anonymous |
Priority: | undecided → low |
Status: | new → pending |
Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.
comment:3 Changed 11 years ago by
Thanks!
It's ok for the complete function from animate.
But the trigger function is not also asynchronous. Please see the following example.
I understand that this change is not possible on the current trigger functions: The behavior should be very too different. But is it possible to add a new trigger function that would be asynchronous. You can call it triggerAsync or triggerAsyncrone or else
Thank you in advance
comment:4 Changed 11 years ago by
oh sorry!
I have upadted your link: http://jsfiddle.net/FrKyN/129/ The result for the complete function in animate is correct for jQuery(edge)and jQuery 1.7.
thanks
comment:5 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Thank you for investigating the issue further.
The problem is in the step function. The complete function is called in synchronous mode. The first complete function is executed when the current step function is not finished. So the stop function stop the next animation.
To solve this problem:
line 8543 of jquery-1.6.4.js source in the step function, don't call directly the complete function but use a setTimeout to have an asynchronous call:
In the same way the trigger function is not asynchronous. Normally events are asynchronous, so it would be interressant to do the same way as before. A suggestion: