In a nested menu, I want to show the submenu of an element when that element is hovered over.
HTML:
<div id="menu">
<div class="menu-main-menu-container">
<ul>
<li id="mojo_page_list_index" class="mojo_active"><a href="http://localhost/index.php">Home</a></li>
<li id="mojo_page_list_over"><a href="http://localhost/index.php/over">Over</a>
<ul>
<li id="mojo_page_list_bedrijfsprofiel"><a href="http://localhost/index.php/bedrijfsprofiel">Bedrijfsprofiel</a></li>
<li id="mojo_page_list_geschiedenis"><a href="http://localhost/index.php/geschiedenis">Geschiedenis</a></li>
</ul>
</li>
<li id="mojo_page_list_contact"><a href="http://localhost/index.php/contact">Contact</a></li>
</ul>
</div>
</div>
jQuery:
(function($){
$(document).ready(function(){
$("ul.menu-main-menu-container li").hover(function () {
$(this).addClass("hover");
$('ul:first', this).css({visibility: "visible",display: "none"}).slideDown(200);
}, function () {
$(this).removeClass("hover");
$('ul:first', this).css({visibility: "hidden"});
});
if ( ! ( $.browser.msie && ($.browser.version == 6) ) ){
$("ul.menu-main-menu-container li ul li:has(ul)").find("a:first").addClass("arrow");
}
});
})(window.jQuery);
What am I doing wrong?