skip to Main Content

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

2

Answers


  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

    Login or Signup to reply.
  2. One possibility is to time delay close see:

    jQuery( document ).ready( function( $ ) {
    setTimeout(
       function(){
          document.querySelector('.dialog-close-button').click();
       }, 4000);
    });
    

    Possible repost of Close Elementor Popup with JavaScript

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search