为博客园(或网站)添加百度分享按钮 自定义调用JS代码

1、百度分享代码调用地址

  http://share.baidu.com/code

根据提示,一步一步的自定义选择,最后复制自定义好的样式,添加到WEB。

2、在页首Html代码中添加复制过来的JS代码

<!--baidu分享-->
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"2","bdPos":"right","bdTop":"168"}};withdocument)0[getElementsByTagName'head')[0]||body).appendChildcreateElement'script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~-new Date)/36e5)];</script>

3、效果请看我的博客页面的右边,蓝色的分享按钮

Published by

风君子

独自遨游何稽首 揭天掀地慰生平