Last active
April 12, 2022 17:09
-
-
Save rmorse/dc3171e6b8fba05aad010da8278cafba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// re init layout after ajax request | |
$( document ).on( "sf:ajaxfinish", ".searchandfilter", function( e, data ) { | |
if ( window.elementorFrontend && window.elementorFrontend.elementsHandler && window.elementorFrontend.elementsHandler.runReadyTrigger) { | |
var runReadyTrigger = window.elementorFrontend.elementsHandler.runReadyTrigger; | |
runReadyTrigger( data.targetSelector ); | |
// NEW - re-init elementor widgets inside the new results: | |
var ajaxTarget = $( data.targetSelector ); | |
if ( ajaxTarget.length > 0 ) { | |
ajaxTarget.find( '.elementor-widget' ).each( function () { | |
runReadyTrigger( $( this ) ); | |
} ); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment