Created
November 18, 2021 16:22
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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