百度分享按鈕提供自定義摘要功能,該功能目前支持自定義qq空間和人人網(wǎng)的摘要內(nèi)容,設(shè)置如下:
1、通過全局配置進(jìn)行修改:
<!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare"> <a class="bds_qzone">QQ </a> <a class="bds_tsina">新浪</a> <a class="bds_tqq">騰訊</a> <a class="bds_renren">人人</a> <span class="bds_more">更多</span> </div> <script type="text/javascript" id="bdshare_js" data="type=slide&mini=1" ></script> <script type="text/javascript" id="bdshell_js"></script> <script type="text/javascript"> //在這里定義bds_config var bds_config = {'bdDesc':'目前支持自定義qq空間,開心網(wǎng)的摘要內(nèi)容'}; document.getElementById('bdshell_js').src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000); </script> <!-- Baidu Button END -->
2、通過增加按鈕html標(biāo)簽的data屬性進(jìn)行修改:
<!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare" data="{'desc':'目前支持自定義qq空間和人人網(wǎng)的摘要內(nèi)容'}"> <a class="bds_qzone">QQ </a> <a class="bds_tsina">新浪</a> <a class="bds_tqq">騰訊</a> <a class="bds_renren">人人</a> <span class="bds_more">更多</span> </div> <script type="text/javascript" id="bdshare_js" data="type=slide&mini=1" ></script> <script type="text/javascript" id="bdshell_js"></script> <script type="text/javascript"> document.getElementById('bdshell_js').src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000); </script> <!-- Baidu Button END -->
更多建議: