I have my gallery menu of Fancybox. And want to add YouTube video in it. Can't find the version of fancybox, because it was in 2015 I think. So now I'm trying to use script:
<script type="text/javascript">
$("a.fancyYoutube").click(function() {
$.fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 680,
'height' : 495,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
}
});
return false;
});
</script>
And HTML is `
<li>
<div class="inner">
<a class="fancyYoutube" href="https://youtube.com/3nYf845dYEs" class="fancy-gallery" data-fancybox-group="gallery" >
<img src="https://i9.ytimg.com/vi/3nYf845dYEs/mq2.jpg?sqp=CKzT-ZAG&rs=AOn4CLDkGeG9Oj6BKh1TyEtauwWKPSax4Q" alt="Stogo rekonstrukcija">
</a>
</div>
</li>
<li>
<div class="inner">
<a href="images/stogo-rekonstrukcija.jpg" title="Mūrinio namo šiferinio stogo rekonstrukcijos darbai" class="fancy-gallery" data-fancybox-group="gallery">
<img src="images/stogo-rekonstrukcija-compressed.jpg" alt="Stogo rekonstrukcija">
</a>
</div>
</li>
But it still don't want to work. Always redirect video link to YouTube, but not in frame. Here is the fancy gallery on my test page http://apdaila.info/