Created
January 7, 2013 05:54
-
-
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
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
| 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