html - How can i close my jquery menu -
I need to close it when I click on the link, but how?
& lt; New class = "navigation" & gt; & Lt; A href = "" class = "menuIcon" & gt; & Lt; I class = "fa-bar" & gt; & Lt; / I & gt; & Lt; / A & gt; & Lt; Ul class = "nav" & gt; & Lt; Li class = "cleanfix" & gt; & Lt; A href = "# home" & gt; Home & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# diensten" & gt; Dyesthen & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# over" & gt; Hat team & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# werkwijze" & gt; WorkViews & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# contact" & gt; Contact & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Neo & gt;
var menu = $ ('naval ul'); $ ("Menu"). Click (function (event) {event.preventDefault (); menu.removeAttr ('style'); menu.slideToggle (); $ (".nav") ToggleClass ("list");});
Inside the click event of your choice. Try using (function):
$ ('. Click (function () {menu.hide ();});
Comments
Post a Comment