Last active
November 14, 2022 12:17
-
-
Save Pebblo/a67cff006343dcfb3b326e33c69c2159 to your computer and use it in GitHub Desktop.
Example of how to force the EE calender for re-render when the window has loaded.
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
<?php //Please do not include the opening PHP tag if you alreayd have one. | |
function tw_ee_cal_rerender(){ | |
wp_add_inline_script( | |
'espresso_calendar', | |
"jQuery(window).on('load', function() { | |
jQuery('#espresso_calendar').fullCalendar( 'render' ); | |
});" | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'tw_ee_cal_rerender', 20); |
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
<?php //Please do not include the opening PHP tag if you alreayd have one. | |
function tw_ee_cal_rerender_on_click(){ | |
wp_add_inline_script( | |
'espresso_calendar', | |
'jQuery( document ).ready(function() { | |
jQuery("#elementor-tab-title-5702").on("click", function() { | |
jQuery("#espresso_calendar").fullCalendar( "render" ); | |
}); | |
});' | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'tw_ee_cal_rerender_on_click', 20); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment