js
window._bd_share_config = {
"common": {
"bdSnsKey":
{}, "bdText": "", "bdMini": "2", "bdMiniList": false, "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)];
html
<div class="bdsharebuttonbox">
<span>分享:</span>
<a title="分享到QQ空间" href="#" class="bds_qzone" data-cmd="qzone"></a>
<a title="分享到新浪微博" href="#" class="bds_tsina" data-cmd="tsina"></a>
<a title="分享到微信" href="#" class="bds_weixin" data-cmd="weixin"></a>
</div>
修改图标样式
.bdsharebuttonbox .bds_qzone {
background: url(/Public/img/shareResource/zone.png) no-repeat no-repeat;
}
.bdsharebuttonbox .bds_tsina {
background: url(/Public/img/shareResource/sina.png) no-repeat no-repeat;
}
.bdsharebuttonbox .bds_weixin {
background: url(/Public/img/shareResource/wchat.png) no-repeat no-repeat;
}
网友评论