【发布时间】:2014-11-07 18:35:41
【问题描述】:
有没有办法在用户向自定义分享按钮分享内容时添加回调?
目前我在弹出窗口中打开一个共享对话框:
<a data-height="600" data-title="Google+" class="popup" href="https://plus.google.com/share?url=MY_URL">Share</a>
$('.popup').click(function(event) {
var width = 575,
height = $(this).data('height'),
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
url = this.href,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(url, $(this).data('title'), opts);
event.preventDefault();
});
在文档中:https://developers.google.com/+/web/share/ 他们说,我们可以在使用他们的 js api 时使用 data-onendinteraction 指定回调。找不到使用自定义共享链接的方法。
【问题讨论】:
-
您是否设法弄清楚如何做到这一点?
-
不,很遗憾没有。
标签: javascript google-plus share