When you execute the stop() method on an animation, some corruption to the original element can occur. This is because the animate() method automatically changes some properties of the element in order to get the correct visual effect.
In normal circumstances the original state of the element is restored during the step() method when the "done" condition is true.
The problem is when you call the stop() method on an element these original properties are overwritten with properties of the element in it's current stopped state.
The easiest way to see this bug is on this example page:
If you click the "Timed Animation" button you'll see that the "overflow" on "Menu 1" is lost.
This is because midway through the animation queue, the stop() method is called on the element. Since the animate() method automatically sets the overflow to hidden (for animating height,) after the stop() method is called and we attempt to restore the element to it's original height, the animate() method sees that the overflow is currently set to "hidden" and therefore never properly removes the overflow value when the animation is done.
I've been able to fix this by tracking the original properties of the element and then clearing the settings once the queue is emptied.
See the following example of my patched code:
You'll notice that on this same example, the element's overflow is correctly reset once the queue clears.
A diff of my changes can be found here:
The main change I did was implement a variable to track the original properties of the element and this gets reset once the animation queue is empty.