Two jQuery functions with one event

Viewed 25

I want to execute this Wordpress-Elementor function:

$( document ).on( 'click', '.close-popup', function( event ) {
        elementorProFrontend.modules.popup.closePopup( {}, event );
    } );

within this event/function:

jQuery(document).ready(function($){
// detects the start of an ajax request being made
$(document).on("sf:ajaxstart", ".searchandfilter", function(){
        $.LoadingOverlay("show", {
        background : "#183A4DED",
        imageColor : "#E9E071"

    });
        
});

which is triggered by a "Search&Filter Pro" AJAX Search event. With this event a spinner with overlay is initialized ( is working ) and an Elementor popup shall be closed.

I am new to javascript. Any answer is welcome!

1 Answers

This works:$('.close-popup').trigger('sf:ajaxstart", ".searchandfilter"');

Related