Add this to your site’s js to enable events such as adding Google Analytics tracking code to individual Carousel slides:
jQuery(document).on( 'jp_carousel.selectSlide', '.jp-carousel-wrap', function( event, slides ) { // This is just to show you what values get passed in. Delete it before going to production. if ( window.console ) { console.log( this ); console.log( event ); console.log( slides ); console.log( slides[0] ); } // Do whatever extra stuff you want here. } );
You can read more about it here.
This entry was posted in Code snippets, Tips & Tricks and tagged Carousel, event, JavaScript. Bookmark the permalink.
Explore the benefits of Jetpack plans
Compare plans in detail to see how Jetpack can help you design, market, and secure your WordPress site.
Compare plans