JS代码如下
$('.menu-item a').each(function(){
if($($(this))[0].href==String(window.location))
$(this).toggleClass('active');
$(this).parent().parent().addClass("show");
$(this).parent().parent().parent().addClass('active');
});