How to close a popup after a few seconds at the click of a spacial button ?
2
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 } );
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
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
Click here to cancel reply.
2
Answers
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 :
Might have gotten som syntax wrong, but it should give you an idea
One possibility is to time delay close see:
Possible repost of Close Elementor Popup with JavaScript