//public js area
$(function () {
Var w=$(window). The width ();
If (w & gt; 768) {
} else {
$(function () {
Var windoww=$(window). The width ();
$(' sp_nav '). Click (function () {
$(' sp_nav '). ToggleClass (' sp_nav_se ');
$(' nav '). ToggleClass (' nav_show ');
});
The $(document). Ready (function () {
Var aMenuOneLi=$(" menu - one & gt; Li ");
Var aMenuTwo=$(" menu - two ");
$(". The menu - one & gt; Li & gt; . The nav - the title. The arrow ".) each (function (I) {
$(this). Click (function () {
If ($(aMenuTwo [I]). The CSS (" display ")=="block") {
$(aMenuTwo [I]). SlideUp (300);
$(aMenuOneLi [I]). RemoveClass (" menu - show ")
} else {
For (var j=0; J & lt; AMenuTwo. Length; J++) {
$(aMenuTwo [j].) slideUp (300);
$(aMenuOneLi [j]. RemoveClass (" menu - show ");
}
$(aMenuTwo [I]). SlideDown (300);
$(aMenuOneLi [I]). AddClass (" menu - show ")
}
});
});
});
});
};
Const BTN=document. QuerySelector (" # BTN ");
Const item=document. QuerySelectorAll (". Menu_item ");
let showCard=(event)=& gt; {
BTN. ClassList. Toggle (" is - rotate ");
For (var I=0; I & lt; Item. Length; I++) {
The item [I] classList. Toggle (` item - ${I} `);
}
}
BTN. AddEventListener (" click ", showCard);
$(function () {
Var Accordion=function (el, multiple) {
This. El=el | | {};
This. Multiple=multiple | | false;
//the Variables privadas
Var links=this. El. Find (' tit ');
//Evento
The links. On (' click '{el: this. El, multiple: this. Multiple}, enclosing dropdown can)
};
Accordion. The prototype. The dropdown can=function (e) {
Var $el=e.d ata. El;
$this=$(this);
$next=$this. Next ();
$next. SlideToggle ();
$this. The parent (). ToggleClass (' open ');
if (! E.d ata. Multiple) {
$el. Find (' submenu '), not ($next). SlideUp (). The parent (). RemoveClass (' open ');
}
};
Var accordion=new accordion ($(' # accordion), false);
$(' submenu li '). Click (function () {
$(this). AddClass (' current '). Siblings (" li "). RemoveClass (" current ");
});
});
})
CodePudding user response:
You put the anonymous functions assigned to the showCard, call, have a didn't pass the event parameter