Jquery 将youtube视频像fancybox中的iframe链接一样传递到facebook
我使用fancybox在弹出窗口上显示视频,也就是标题上类似facebook的按钮Jquery 将youtube视频像fancybox中的iframe链接一样传递到facebook,jquery,html,fancybox,fancybox-2,Jquery,Html,Fancybox,Fancybox 2,我使用fancybox在弹出窗口上显示视频,也就是标题上类似facebook的按钮 <a class="fancybox-media change_status" href="http://www.youtube.com/watch?v=opj24KnzrWo" title="sa">Youtube</a> this.href标记出现问题,在FB上显示href URL必须是绝对URL时出错。尝试console.log this.href并在浏览器中运行完整URL以检查其
<a class="fancybox-media change_status" href="http://www.youtube.com/watch?v=opj24KnzrWo" title="sa">Youtube</a>
this.href标记出现问题,在FB上显示href URL必须是绝对URL时出错。尝试console.log this.href并在浏览器中运行完整URL以检查其功能。Facebook可能在实体替换方面存在问题;。谢谢,修复了以前没有http的传递:
$('.fancybox-media')
.attr('rel', 'media-gallery')
.fancybox({
href: $(this).attr('href'),
openEffect: 'none',
closeEffect: 'none',
prevEffect: 'none',
nextEffect: 'none',
autoDimensions: false,
padding: [15, 15, 0, 15],
height: 370,
width: 490,
arrows: false,
helpers: {
media: {},
buttons: {},
title: {
type: 'inside'
}
},
beforeShow: function () {
if (this.title) {
this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=' + this.href + '&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px;" allowTransparency="true"></iframe>';
}
}
});