Looking for help with a jQuery script as I am a beginner in using jQuery.
jQuery(document).ready(function ($) {
$(".sub-menu").hide();
$(".current_page_item .sub-menu").slideDown(200);;
$("li.menu-item").click(function () {
if ($('.sub-menu', this).length >=1) {
event.preventDefault();
}
$(".sub-menu").slideUp(200);;
$(this).find(".sub-menu").slideDown(200);;
event.stopPropagation();
});
});
The current script is running smoothly but now I wish to extend it to the third level. For example:
Page 1 ------> Page 1 Second Level -----------> Page 1 Third Level.
At present, the second and third levels show up when clicking on the first-level menu. However, the third level should only be visible if the 'Second Level Page 1' is clicked.
Can anyone offer assistance?
Thanks in advance, Thorsten
EDIT Seeking advice on why the script isn’t functioning properly on Firefox?
After clicking, Firebug reports: ReferenceError: event is not defined nav.js:7:5