I just wrote my fist drop down menu. I’ve never really had to make one, but decided to give it ago and pretty much give it out for free online if it works. Its not fancy, and its not responsive, although I plan on adding responsiveness later. What do you think of the code though? I am always afraid I am writing sloppy code, when I make things other people might use in their own code.
This won’t really let you include more than one dropdown or make individual listeners for each individual element. You could do something like this to handle that:
Which will allow you to use it on multiple elements and it will the child submenu. You also have a lot of unnecessary CSS which actually makes the above look like it doesn’t work, but it does.
It needs more modification than this, but this should give you a start.
Also, for quick online testing and sharing use JSFiddle or CodePen instead of putting files out there for someone to inspect source. CodePen links will actually embed into Discourse (the forum software Sitepoint uses)