Skip to content

Instantly share code, notes, and snippets.

@kjtolsma
Last active February 8, 2017 15:53
Show Gist options
  • Save kjtolsma/d63493e07b7bd3c1d80778ce42f3a059 to your computer and use it in GitHub Desktop.
Save kjtolsma/d63493e07b7bd3c1d80778ce42f3a059 to your computer and use it in GitHub Desktop.
$( '.person' ).hover( function() {
$( this ).find( 'video' ).get(0).play();
}, function() {
//$( this ).find( 'video' ).get(0).load();
//$( this ).find( 'video' ).get(0).pause();
} );
$( '.video' ).on( 'play', function() {
$( '.video-overlay-wrapper' ).fadeOut( 400 );
} );
/* iOS video background support fix */
var iOS = /iPad|iPhone|iPod/.test( navigator.platform );
if ( iOS ) {
$( '.person video' ).hide();
$( '.person .person-image' ).show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment