2017년 10월 11일 수요일

Fancybox 1.3.4 and youtube iframe, not swf (flash)

Plz refer this, http://it-blog.club/fancybox-iframe/

just translate the page and that's how-to.

<script type="text/javascript">
$(document).ready(function() {
$("#sia").click(function() {
$.fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 720,
'height' : 405,

'href' : this.href,

'type' : 'iframe',
'iframe': {
'scrolling': 'auto',
'preload': true
}
// 'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
// 'type' : 'swf',
// 'swf' : {
// 'wmode' : 'transparent',
// 'allowfullscreen' : 'true'
// }
});
return false;
});
});
</script>


<div class="float_l imgdiv"><a id="sia" class="event iframe" title="" href="https://www.youtube.com/embed/ABCDefgHIJKlmn"><img class="imgbox" alt="" src="/imgdir/image.jpg"><br>Link Text</a></div>




The commented lines are the previous codes that worked well before Youtube stopped supporting ㄻAdobe Flash(SWF) embedding.

The attributes of 'href', 'type', and 'iframe' are modified.

Now it works fine with the new URL format for embedding like https://www.youtube.com/embed/ABCDefgHIJKlmn

Thank you it-blog.club!


댓글 없음:

댓글 쓰기

Xubuntu: Installing a Printer (Canon G3060 PIXMA)

$ sudo apt install system-config-printer Download the proper driver for linux from Canon website. Turn on the printer and set up its WiFi. C...