Skip to content

Instantly share code, notes, and snippets.

@tomharrigan
Created January 7, 2013 05:54
Show Gist options
  • Select an option

  • Save tomharrigan/4472780 to your computer and use it in GitHub Desktop.

Select an option

Save tomharrigan/4472780 to your computer and use it in GitHub Desktop.
add fade effect to featured products slider in WooStore. Add this to functions.php
remove_action('wp_head', 'woo_jcarousel_script');
add_action('wp_head', 'woo_jcarousel_fade_script');
function woo_jcarousel_fade_script(){
if ( (is_home() || is_front_page()) && !is_paged() ) {
?>
<script type="text/javascript">
// Featured product slider
jQuery(document).ready(function() {
jQuery('#featured-products.fp-slider ul.featured-products').jcarousel({
scroll: 2,
itemLoadCallback: {
onBeforeAnimation: mycarousel_fadeOut,
onAfterAnimation: mycarousel_fadeIn
}
});
function mycarousel_fadeOut(carousel) {
var JCcontainer = carousel.clip.context;
jQuery(JCcontainer).fadeOut();
}
function mycarousel_fadeIn(carousel) {
var JCcontainer = carousel.clip.context;
jQuery(JCcontainer).fadeIn();
}
});
</script>
<?php
}
} // END woo_jcarousel_script()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment