wlvlsup-dropdown
v1.0.0
Published
dropdown menu module using Javascript
Downloads
9
Readme
Use ddInitialize() to create dropdown menu behaviour on a parent element with child dropdown menu.
ddInitialize() takes two parameters with an optional third parameter. It assumes you have a parent element with it's own id and child element with it's own id in your HTML file.
The first parameter is the HTML ID of the element you'd like to set as the parent. This should be an element that contains a child element you wish to reveal.
The second parameter is the HTML ID of the element you'd like to set as the child. This is the element that will be revealed when the parent element is interacted with.
The third parameter is the dropdown menu mode. By default it is set to 'hover' so that when a pointer hovers over the parent element it reveals the child. When the pointer element moves outside of the parent OR the child the child element is hidden. If the third parameter is set to anything other than 'hover' it will default to 'click' to reveal the child element.