Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close Elementor Popup with JavaScript

I have a popup created with Elementor that plays a video when opened. I am trying to get it to close after the video if finished (say 90 seconds), but I can't find how to close an element or Popup with Javascript.

I have tried something like this https://github.com/elementor/elementor/issues/7085, but as it's not a click action, just a wait and close function I don't think I can't get it to work.

Any direction would be helpful. Thank you.

like image 812
William Avatar asked Jul 26 '26 19:07

William


1 Answers

The elementor guys gave me this:

jQuery( document ).ready(function($){
$(document).on('click','.elementor-location-popup a', function(event){
    elementorProFrontend.modules.popup.closePopup( {}, event);
}) });

I hope it works for you.

like image 109
Ka' de Xaeoc Avatar answered Jul 28 '26 10:07

Ka' de Xaeoc