Created
November 16, 2016 13:26
-
-
Save kjtolsma/2f749ae09de62732baa76292225080ac to your computer and use it in GitHub Desktop.
This file contains 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
$( '.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