Last active
October 16, 2017 20:19
-
-
Save brunopulis/e29395d280090f5c009e to your computer and use it in GitHub Desktop.
Reload Iframe with embed
This file contains hidden or 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
// 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