Last active
August 29, 2015 14:14
-
-
Save n7studios/227957f0de441c6b781d to your computer and use it in GitHub Desktop.
Envira Gallery - Reload Enviratope on Click
This file contains hidden or 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 | |
/** | |
* Plugin Name: Envira Gallery - Reload Enviratope on Click | |
* Plugin URI: http://enviragallery.com | |
* Version: 1.0 | |
* Author: Tim Carr | |
* Author URI: http://www.n7studios.co.uk | |
* Description: Register a click handler to reload Envira Gallery layouts. Useful when an Envira Gallery isn't visible on page load. | |
*/ | |
/** | |
* Reload Enviratope on item click | |
*/ | |
function envira_gallery_reload_enviratope( $data ) { | |
?> | |
$('.su-tabs-nav > span').on('click', function(e) { | |
setTimeout(function(){ envira_container_<?php echo $data['id']; ?>.enviratope(); }, 100); | |
}); | |
<?php | |
} | |
add_action( 'envira_gallery_api_end', 'envira_gallery_reload_enviratope' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment