I’m using a jquery-ui accordion that opens a section on mouse hover instead of on click, however I’ve noticed if you mouse over multiple items quickly, the item that gets selected is the first item your mouse was over, not the last one.
You can test this out on either their demo page or this copy of the demo on jsfiddle: Simply mouse over the last item so it expands, then move your mouse quickly to the first item, passing the 3nd and 2rd item as you go. The end result is the 3nd item is open, although your mouse is over the first item. (You can also do it in the reverse, but its easiest to duplicate the problem going from bottom to top)
How can I prevent this behavior from happening so the final item that is open is the one the mouse is over, and not the first item the mouse went over?
jQuery UI has implemented the
hoverIntentfunctionality for their accordion selections to combat animation queue issues. The snippet they used is as follows ->