Skip to content

Instantly share code, notes, and snippets.

@tomhemsley
Last active August 29, 2015 14:01
Show Gist options
  • Save tomhemsley/b5d7e27afaadb4e4030d to your computer and use it in GitHub Desktop.
Save tomhemsley/b5d7e27afaadb4e4030d to your computer and use it in GitHub Desktop.
/**
* INSTALLATION: this code should be pasted into your theme's functions.php file.
*
*/
function metaslider_slide_change_callback($options, $slider_id, $settings) {
$options['after'][] = "
// debug
console.log("current slide: " + slider.currentSlide);
if (slider.currentSlide == 1) {
// do something
}
if (slider.currentSlide == 2) {
// do something
}
if (slider.currentSlide == 3) {
// do something
}
";
return $options;
}
add_filter('metaslider_flex_slider_parameters', 'metaslider_slide_change_callback', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment