1. 程式人生 > >百度分享

百度分享

fig col -c attr min att cdn des ()

1 <div class="bdsharebuttonbox" data-url="{url}" data-title="{title}">
2   <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
3   <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空間"></a>
4   <a href="#" class="bds_weixin" data-cmd="weixin"
title="分享到微信"></a> 6 </div>

 1 <script>
 2     var shareurl = "";
 3     var sharedesc="";
 4     var sharepic="";
 5     var sharetitle="";
 6     $(".bdsharebuttonbox a").mouseover(function () {
 7         shareurl = $(this).parents(".bdsharebuttonbox").attr("data-url");
 8         sharedesc=$(this
).parents(".bdsharebuttonbox").attr("data-desc"); 9 sharepic=$(this).parents(".bdsharebuttonbox").attr("data-pic"); 10 sharetitle=$(this).parents(".bdsharebuttonbox").attr("data-title"); 11 }); 12 function SetShare(cmd, config) { 13 if (shareurl) { 14 config.bdUrl = shareurl;
15 } 16 if(sharedesc){ 17 config.bdDesc = sharedesc; 18 } 19 if(sharepic){ 20 config.bdPic = sharepic; 21 } 22 if(sharetitle){ 23 config.bdText = sharetitle; 24 } 25 return config; 26 } 27 window._bd_share_config = {"common": {onBeforeClick:SetShare,"bdSnsKey":{},"bdMini":"2","bdMiniList":false,"bdStyle":"0","bdSize":"24"}, "share": {}} 28 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)]; 29 </script>

 

百度分享