【发布时间】:2014-06-17 10:43:13
【问题描述】:
我正在使用 fancybox 在弹出窗口上显示 youtube 视频,在弹出窗口中我使用了 fb 分享和点赞按钮,但是当我单击共享按钮时,它正在浏览器弹出窗口中打开,我想在 fancybox 灯箱中打开以保持一致性。
无法弄清楚我如何在弹出窗口而不是浏览器弹出窗口中显示 facebook 共享对话框。
$('.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=http:' + this.href + '&layout=button&show_faces=false&width=500&action=like&font&colorscheme=light&height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px; float:right;" allowTransparency="true"></iframe>';
this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=http:' + this.href + '&layout=button&show_faces=false&width=500&share=true&action=like&font&colorscheme=light&height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px; float:left;" allowTransparency="true"></iframe>';
}
}
});
【问题讨论】:
标签: jquery fancybox fancybox-2