toggle is bound to the dropdown's click event, and is invoked when you click a dropdown to show/hide its menu.