js實現分享功能
阿新 • • 發佈:2019-01-06
分享到新浪微博function shareToXl(title,url,picurl){var sharesina='http://v.t.sina.com.cn/share/share.php?title="+title+"&url="+url;var top = (window.outerHeight-505)/2;
var left = (window.outerWidth-615)/2;
window.open(sharesina,'_blank','width=615,height=505,top='+top+',left='+left);}分享到QQ http://connect.qq.com/widget/shareqq/index.html分享到QQ空間 http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey 分享到微信 http://s.jiathis.com/qrcode.php?url=連結分享到騰訊微博 http://v.t.qq.com/share/share.php上面地址好像用不了 http://share.v.t.qq.com/index.php(沒測)
var left = (window.outerWidth-615)/2;
window.open(sharesina,'_blank','width=615,height=505,top='+top+',left='+left);}分享到QQ http://connect.qq.com/widget/shareqq/index.html分享到QQ空間 http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey
注意本地測試時url不能直接傳入location.href