Skip to content

Instantly share code, notes, and snippets.

@stoffl6781
Created November 18, 2021 16:22
Show Gist options
  • Save stoffl6781/e9551af0b20575b1d61e449b4d75cac3 to your computer and use it in GitHub Desktop.
Save stoffl6781/e9551af0b20575b1d61e449b4d75cac3 to your computer and use it in GitHub Desktop.
Close Elementor menu popup on click - with binding to one popup and not all
This has the advantage that only this popup is closed. All other popups remain open.
If you want all popups to be closed, the CSS class "elementor-location-popup" must be used
Add Script as HTML Widget to Popup
<script>
jQuery(function($){
$(document).on('click','.<<YOUR CSS POPUP CLASS>> a', function(event){
elementorProFrontend.modules.popup.closePopup( {}, event);
});
});
</script>
//// Popup settings
Add a unique CSS class to the popup
Change the Script with your CSS class
//// Example with Popup Class: my__menu
<script>
jQuery(function($){
$(document).on('click','.my__menu a', function(event){
elementorProFrontend.modules.popup.closePopup( {}, event);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment