When using jQuery's .animate()
function to animate elements, it is important to use .stop(false,true)
to prevent any unexpected animation issues.
For example, I recently attempted to create a navigation menu that appears on hover of certain sections. You can see a demo here:
http://jsfiddle.net/meo/Kbeg8/
If you slowly move your cursor out of the gray element at the top, you may notice an infinite animation loop occurring. This is because the element flying in is a child of the element triggering the animation.
As I have encountered this issue before, I am curious if there is a way to address it using pure CSS (such as preventing children from triggering parent transitions). If not, how would you recommend solving this problem with JavaScript?