百度一键分享功能
http://share.baidu.com/code/advance
另外一种方法:
1. 引入js库文件
<script src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=2&lang=zh" type=text/javascript charset="utf-8"></script>
<script src="http://static.bshare.cn/b/bshareC0.js" type=text/javascript charset="utf-8">
2. 将下面的代码插入到要分享的位置即可
<div class="bshare-custom">
<a class="bshare-qzone" title=分享到QQ空间></a>
<a class="bshare-sinaminiblog" title=分享到新浪微博>
</a><a class="bshare-renren" title=分享到人人网></a>
<a class="bshare-qqmb" title=分享到腾讯微博></a>
<a class="bshare-douban" title=分享到豆瓣></a>
<a class="bshare-more bshare-more-icon more-style-addthis" title=更多平台></a>
<span class="BSHARE_COUNT bshare-share-count">0</span>
</div>
另外一种方式:
引用js代码
//百度一键分享
window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "分享到:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"] } }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
插入分享按钮:
<div class="bdsharebuttonbox" data-tag="share_1" style="position:absolute;top:90px;">
<a class="bds_weixin" data-cmd="weixin"></a>
<a class="bds_sqq" data-cmd="sqq"></a>
<a class="bds_qzone" data-cmd="qzone"></a>
<a class="bds_tsina" data-cmd="tsina"></a>
<a class="bds_baidu" data-cmd="baidu"></a>
<a class="bds_renren" data-cmd="renren"></a>
<a class="bds_tqq" data-cmd="tqq"></a>
<a class="bds_more" data-cmd="more">更多</a>
<a class="bds_count" data-cmd="count"></a>
</div>