Plugin Elementor: How to open and close a popup via button?

With relatively simple means you can create any button that opens an Elementor popup when clicked and also closes this popup after clicking again. Below is only the basic structure.

Settings in the popup under „Open By Selector“:

a[href="#bmenue"]

Script to „close“ the popup:

jQuery("#burger-menue").click(function(){
   if (jQuery("#burger-menue").hasClass("open")) {
       jQuery("#burger-menue").removeClass("open");
       jQuery(".dialog-close-button").click();
   }
   else {
      jQuery("#burger-menue").addClass("open");
   }
});
Without cookies
This website does not use cookies or tracking. More information can be found in the privacy policy.