(function($){
// wait for Elementor’s frontend to be ready
$(window).on('elementor/frontend/init', function() {
// when any Accordion widget renders…
elementorFrontend.hooks.addAction(
'frontend/element_ready/accordion.default',
function($scope) {
// loop its panels
$scope.find('.elementor-accordion-item').each(function() {
var $panel = $(this);
// if this panel contains an active menu link…
if ( $panel.find('.elementor-nav-menu .current-menu-item').length ) {
// “click” its header to open it
$panel.find('.elementor-accordion-title').trigger('click');
}
});
}
);
});
})(jQuery);