Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
animate() - callback function is executed before animation has been completed in latest jquery 3.2.1 #3861
We have upgraded jquery version from 3.1.1 to 3.2.1. Now the code inside animation()- callback function is executed before animation is completed and then it executes the next line
JQuery 3.1.1 output
Sample Link(jquery 3.2.1): https://www.w3schools.com/code/tryit.asp?filename=FLMCAWA173W6
Sample Link(jquery 3.1.1): https://www.w3schools.com/code/tryit.asp?filename=FLMETVQCUR42
Please let me know if you have any concern,
Thanks for your help in advance.
This appears to be a case of code changes affecting the most likely outcome of a race condition. jQuery animations can resolve synchronously, and a 1 millisecond duration is short enough that it has almost always elapsed by the time we check for completion in the first tick as of 6d43dc4 (on my computer, 3 ms seems to always avoid the synchronous completion and 2 ms is pretty much a coin flip). However, I'm not convinced that this is a problem with jQuery.
If you require asynchrony, I recommend using