js选择文字实现打开分享

百度分享

直接复制就能使用

    window._bd_share_config = {
        "common": {
            "bdSnsKey": {},
            "bdText": "",
            "bdMini": "2",
            "bdMiniList": false,
            "bdPic": "",
            "bdStyle": "0",
            "bdSize": "32"
        },
        "share": {},
        // "image":{
        //     "viewList":["bdhome","tsina","weixin","tqq"],
        //     "viewText":"分享到:",
        //     "viewSize":"16"},
        "selectShare": {
            "bdContainerClass": null,
            "bdSelectMiniList": ["bdhome", "tsina", "weixin", "tqq"]
        }
    };

    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)];

实现效果如下:
js选择文字实现打开分享_第1张图片

你可能感兴趣的:(js效果)