I'm looking to make a simple nested navigation menu that "slides" or "flys" out horizontally-left on hover. I assume the only way to achieve this is with jQuery so I have been playing around with it.
Initial State
Hover State
EDIT: I realize this picture looks a bit wrong. I want the entire ul.sub-menu (ie: PEOPLE & APPROACH) to slide out together, not sequentially.
The general structure is:
<nav>
<ul>
<li>ABOUT
<ul class="sub-menu">
<li>PEOPLE</li>
<li>APPROACH</li>
</ul>
</li>
<li>PROJECTS</li>
<li>CONTACT</li>
</ul>
</nav>
My jQuery is:
$("nav li").on('hover', function(){
$(this).children(".sub-menu").animate({width: 'toggle'});
});
Currently my li's are floated.
My issue is when I hover over the parent LI, the .sub-menu fades in but is down a line and everything is jumping around due to floats.
Can someone point me in the right direction?