Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Issue with drop-down menu Reply To: Issue with drop-down menu

#148196
g3logic
Participant

Toggling your animation using hover is probably not your best bet. Also, using slideUp and slideDown is needlessly setting the submenu to display none, which is also causing a stuttering problem if you have your mouse just below the menu item.

You’re better off using animate to move the panel up and down and trigger it using mouseenter and mouseleave. I would also use divs instead of unordered lists (just my preference).

Also, you are going to want to add stop() to your tab that slides left to right to interrupt the animation when you move your mouse quickly from one menu item to another.

If you aren’t already familiar with gsap, I would STRONGLY recommend you check it out. Makes creating this kind of animation SUPER easy! http://www.greensock.com/gsap-js