'Elementor! How to close a popup after a few seconds at the touch of a button I make

How to close a popup after a few seconds at the click of a spacial button ?



Solution 1:[1]

I have written it in the comments, by I will answer as well.

Elementor Pro has JS functions for the popups. So you can call it like this elementorProFrontend.modules.popup.closePopup( { id: yourPopupIdHere } );

All together :

jQuery( document ).ready( function( $ ) {
    $( document ).on( 'click', '.close-popup', function( event ) {
        setTimeout(function() { 
            elementorProFrontend.modules.popup.closePopup( {id: yourPopupIdHere}, event )} );
        }, 4000);
      });
} );

Might have gotten som syntax wrong, but it should give you an idea

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stender