Skip to content

Instantly share code, notes, and snippets.

@lucianobragaweb
Created September 17, 2020 16:27
Show Gist options
  • Save lucianobragaweb/956d3772035aa24ae5b5d7bae8519646 to your computer and use it in GitHub Desktop.
Save lucianobragaweb/956d3772035aa24ae5b5d7bae8519646 to your computer and use it in GitHub Desktop.
Configuração Magnific Popup
(function($) {
$(window).load(function () {
// retrieved this line of code from http://dimsemenov.com/plugins/magnific-popup/documentation.html#api
$.magnificPopup.open({
items: {
src: 'https://www.youtube.com/watch?v=7eo8XpT4CmM'
},
type: 'iframe',
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
'</div>',
patterns: {
youtube: {
index: 'youtube.com/',
id: 'v=',
src: '//www.youtube.com/embed/%id%?autoplay=1'
}
},
srcAction: 'iframe_src',
}
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment