Calvin Cheng Calvin Cheng - 1 year ago 104
Javascript Question

Closing the dropdown button programmatically

I am using this zurb-foundation dropdown button -

But I have an additional requirement to close the dropdown list when a user clicks outside the dropdown button itself or when the user clicks on an item in the dropdown list, so I need a way to programmatically close an open dropdown list on an on-click event.

What's the javascript call I need to make to programmatically close an open dropdown list?

Answer Source

After some searching here is a slightly cleaner way of doing it:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download