美文网首页
web分享到新浪微博、微信、qq空间

web分享到新浪微博、微信、qq空间

作者: 是狮子呀_ | 来源:发表于2020-07-09 17:33 被阅读0次
image.png
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;
    }

相关文章

网友评论

      本文标题:web分享到新浪微博、微信、qq空间

      本文链接:https://www.haomeiwen.com/subject/pcvscktx.html