Dropdown menu won't close when an item is clicked - jQuery -
I am trying to create a responsive menu and I'm going with one last thing that I have to do with it I am trying. When the menu item is clicked, that page is navigating to the right place, but this menu is not closed
Here's my code:
& Lt; A href = "#" class = "mobile" & gt; Menu & lt; / A & gt; & Lt; Ul class = "hide menu mobile" & gt; & Lt; Li & gt; & Lt; A href = "about #" & gt; About & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# Schedule" & gt; Schedule & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# Trainers" & gt; Instructor & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#place" & gt; Venue & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# sponsor" & gt; Sponsor & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" class = "menu-reg" & gt; Sign up now & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; jQuery:
$ ('ul.mobile a'). Bind ('vclick', function () {$ ('ul.menu .mobile') Hide ();});
Try it out:
$ ('ul .mobile a '). Bind ('vclick click', function () {$ ('ul.menu'). Hide ();});
Comments
Post a Comment