Skip to content

Instantly share code, notes, and snippets.

@kjtolsma
Created November 16, 2016 13:26
Show Gist options
  • Save kjtolsma/2f749ae09de62732baa76292225080ac to your computer and use it in GitHub Desktop.
Save kjtolsma/2f749ae09de62732baa76292225080ac to your computer and use it in GitHub Desktop.
$( '.pt-page-slider' ).flexslider( {
animation: 'fade',
controlNav: true,
directionNav: true,
touch: false,
slideshow: false,
manualControls: '.page-slider-flex-control a',
start: function( slider ) {
var activeVideo = $( '.flex-active-slide video' );
if ( $( activeVideo ).length ) {
$( activeVideo ).get(0).play();
}
$( '.pt-next-slide' ).click( function( e ) {
e.preventDefault();
slider.flexAnimate( slider.getTarget( 'next' ) );
} );
},
after: function( slider ) {
var activeVideo = $( '.flex-active-slide video' );
if ( $( activeVideo ).length ) {
$( activeVideo ).get(0).play();
}
},
before: function( slider ) {
var activeVideo = $( '.flex-active-slide video' );
if ( $( activeVideo ).length ) {
$( activeVideo ).get(0).pause();
}
},
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment