1. 程式人生 > >關於分享,bshare分享&百度分享

關於分享,bshare分享&百度分享

 <!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>百度分享</title>
    <style type="text/css">
        /*再樣式上自定義預設按鈕圖片*/
        .bdshare-button-style0-16 a.bds_tsina{
            background-position: 0 0;
            background: url(http://i0.letvimg.com/pay/201504/27/1027/qqzonebg.png) no-repeat;
            width:52px;
            height:52px;
        }
    </style>
</head>
<body>
<!--
百度分享較為簡單,大家可直接到
http://share.baidu.com/code/advance參考
-->
<!-- 分享按鈕 -->
<div class="bdsharebuttonbox">
    <a href="#" class="bds_qzone" data-cmd="qzone"></a>
    <a href="#" class="bds_tsina" data-cmd="tsina"></a>
    <a href="#" class="bds_tqq" data-cmd="tqq"></a>
    <a href="#" class="bds_renren" data-cmd="renren"></a>
    <a href="#" class="bds_weixin" data-cmd="weixin"></a>
</div>
<!--
common : {
    bdText : '自定義分享內容',
    bdDesc : '自定義分享摘要',
    bdUrl : '自定義分享url地址',  
    bdPic : '自定義分享圖片'
}, -->
<script>
    window._bd_share_config = {
        "common": {
            "bdText": "hello123456",
            "bdDesc":"111",
            "bdUrl":"http://www.letv.com",
            "bdPic": "http://i1.letvimg.com/lc03_iscms/201510/15/09/24/01b234e689e04beeae4c1ed7251c36a0.jpg",
        },
        "share": {
        },
        "image": {"viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "分享到:", "viewSize": "16"},
        "selectShare": {"bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"]}
    };
    document.body.appendChild(document.createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5);
</script>
</body>