[Solved] jQuery Menu Broken
Posted: Sat Apr 11, 2015 6:42 pm
Our site is being updated, and as a result of using a newer version of jQuery, 1.9+, the existing accordion menu has broken.
My best guess is that it's to do with .slideToggle command.
Does anyone know how to fix this because I'm stuck?
My best guess is that it's to do with .slideToggle command.
Does anyone know how to fix this because I'm stuck?
Code: Select all
<__script__ type="text/javascript">
$(document).ready(function(){
$('ul.menu ul').hide();
$('ul.menu').find("li.selected").parent().show();
$('ul.menu').find("li.selectedparent").parent().show();
$('ul.menu li a').not('ul ul a').click(
function() {
var checkElement = $(this).next();
var parent = this.parentNode.parentNode.id;
if($('#' + parent).hasClass('noaccordion')) {
if((String(parent).length > 0) && (String(this.className).length > 0)) {
$(this).next().slideToggle('normal');
}
}
if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
if($('#' + parent).hasClass('collapsible')) {
$('#' + parent + ' ul:visible').slideUp('slow');
}
return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#' + parent + ' ul:visible').slideUp('slow');
checkElement.slideDown('slow');
return false;
}
}
);
})
</__script>