Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active November 14, 2022 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/a67cff006343dcfb3b326e33c69c2159 to your computer and use it in GitHub Desktop.
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.
<?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);
<?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