I'm having trouble with the second sub-menu in this menu. It doesn't open the second sub-menu item. What can I do?
<div id='cssmenu'>
<ul>
<li class='active'><a href='index.html'><span>normal menu</span></a></li>
<li class='has-sub'><a href='#'><span>menu with sub menu</span></a>
<ul>
<li><a href='#'><span>first sub menu</span></a></li>
<ul>
<li><a href='#'><span>second sub menu</span></a></li>
</ul>
<li><a href='#'><span>normal menu</span></a></li>
<li class='last'><a href='#'><span>normal menu</span></a></li>
</ul>
</li>
</ul>
</div>
I am using jquery-1.7.2.min.js and this is my jQuery code:
$(document).ready(function () {
$('#cssmenu > ul > li > a').click(function () {
$('#cssmenu li').removeClass('active');
$(this).closest('li').addClass('active');
var checkElement = $(this).next();
if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {
return false;
}
if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#cssmenu ul ul:visible').slideUp('normal');
checkElement.slideDown('normal');
return false;
}
});
});