Skip to content

Instantly share code, notes, and snippets.

@brunopulis
Last active October 16, 2017 20:19
Show Gist options
  • Save brunopulis/e29395d280090f5c009e to your computer and use it in GitHub Desktop.
Save brunopulis/e29395d280090f5c009e to your computer and use it in GitHub Desktop.
Reload Iframe with embed
// Marca o video esta sendo assistido
// E carrega a legenda dinamicamente com atributo data-*
//
$(function() {
var thumb = $( '.video-item a' ),
mask = $( '.video-item a .mask' ).hide();
// Reload Thumb
thumb.on('click', function(e) {
e.preventDefault();
var data_video = $(this).data('video'),
data_title = $(this).data('title'),
data_subtitle = $(this).data('subtitle');
$('iframe').attr('src', data_video);
$('.description-video .title').text(data_title);
$('.description-video .subtitle').text(data_subtitle);
// Toggle Mask
mask.hide();
$(this).find('.mask').show();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment