Currently, I am in the process of creating a dropdown menu. However, I am facing an issue where the menu does not slide down or up smoothly when clicked. The animations seem to be delayed or non-existent.
$('.menu-vertical .nav-menu > li').on('click', function(e) {
e.preventDefault();
$(this).find('ul').slideToggle('2000', 'swing');
});
.menu-vertical .nav-menu li ul {
position: relative;
background: #f5f5f5 !important;
top: 0;
display: none;
transition: all .4s ease;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<nav class="menu-vertical">
<ul class="nav-menu">
<li>this is head
<ul>
<li>this is one</li>
<li>this is one</li>
<li>this is one</li>
<li>this is one</li>
</ul>
</li>
<li>head is head</li>
<li>head is head</li>
</ul>
</nav>