我正在使用 fancybox 来显示图像,我想在图像下显示社交网络按钮。但是我在使用 addthis 时遇到了一些问题,按钮没有显示,即使我再次渲染 addthis,它们也只是普通链接。
Javascript:
beforeShow: function () {
if (this.title) {
// New line
this.title += '<br />';
//addThis
this.title += '<div id="toolbox" class="addthis_toolbox addthis_default_style addthis_32x32_style"></div>';
}
}, afterShow: function () {
var tbx = document.getElementById("toolbox"),
svcs = {email: 'Email', print: 'Print', facebook: 'Facebook', expanded: 'More'};
for (var s in svcs) {
tbx.innerHTML += '<a class="addthis_button_'+s+'">'+svcs[s]+'</a>';
}
//addthis.init();
//addthis.toolbox('#toolbox');
//addthis.button('.addthis_button');
addthis.toolbox("#toolbox");
//addthis.button(".addthis_button_email");
},
结果:
提前致谢!