If you want to close custom pop-up menu on link click in Elementor, follow along the instructions below and you should be able to set it up like a pro. When you want to create a custom nav menu using Elementor, you will find out that there is no option to automatically close the popup when you click on a menu when the link is on the same page. Fortunately, there is a fast and efficient way of resolving this. Found this gem article from Element How.
- Insert an HTML Element on the popup you just created.
- Copy the following code.
<script>
jQuery(function($){
$(document).on('click','.elementor-location-popup a', function(event){
elementorProFrontend.modules.popup.closePopup( {}, event);
});
});
</script>
If done correctly, the link should close whenever you click a menu.