跟随这个小提琴
$(".fancybox")
.attr('rel', 'gallery')
.fancybox({
beforeShow: function () {
if (this.title) {
// New line
this.title += '<br />';
// Add tweet button
this.title += '<a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="' + this.href + '">Tweet</a> ';
// Add FaceBook like button
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>';
}
},
afterShow: function () {
// Render tweet button
twttr.widgets.load();
},
helpers: {
title: {
type: 'inside'
}, //<-- add a comma to separate the following option
buttons: {} //<-- add this for buttons
},
closeBtn: false, // you will use the buttons now
arrows: false
});
我似乎无法让 Facebook/Tweet 按钮工作,它们根本没有出现。
作为一个额外的皱纹,fancybox 代码是从一个 php 文件中提取的,这可以解释为什么它不起作用,但我仍然不确定如何修复它。
会接受任何建议,希望能够使个人照片可以轻松地在 Facebook 上共享。
我的网站为什么(不要判断!到目前为止只有几个小时的工作,大声笑)只有最新的马有fancybox脚本,我在我们工作的时候正在建设:S。