Make dropdown menu disappear on click-away

I’ve made a drop down menu using an opacity animation on the sub-menu elements.

How can I make the drop down menu disappear if the user clicks anywhere else on the website?

Thanks

Hello! Currently, the background cannot be used as a trigger to close a menu designed with animations (added this to our wishlist). However, if your menu is created using the Hotspot widget, it can be closed by clicking anywhere outside of it.