I wish to create a menu (a sign-up menu), see this to get an idea of it. When user clicks on this button/link a drop-down menu appears, using which he can do something (here login).
The behaviour of the link should be the following:
- The drop-down menu should appear when clicked on this button/link.
- when clicked anywhere on the page (including the button/link itself), but outside the menu, the menu should disappear.
- If clicked somewhere on the drop-down menu, the menu should not disappear.
- All the controls in the drop-down menu should work.
I did somehow managed to get first three working, but then the controls within the drop-down menu (4th behaviour) are not working.
The javascript/jQuery code along with html code is given here (jsfiddle link, same as above). You can fork it and make changes.
Thanks.