Q:

Closing the dropdown button programmatically

I am using this zurb-foundation dropdown button - http://foundation.zurb.com/sites/docs/v/5.5.3/components/dropdown_buttons.html
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?

A:

After some searching here is a slightly cleaner way of doing it:
Foundation.libs.dropdown.close($('#id_of_dropdown_list'));

A:

Old question but this worked for me.
$(document).foundation('dropdown', 'close', $('.f-dropdown'));

A:

In Foundation 6.2, you can do something like:
$('.dropdown-pane').foundation('close');

For reference: http://foundation.zurb.com/sites/docs/dropdown.html#close

