admin管理员组

文章数量:1123367

PC端分享微信,QQ,微博

HTML

 <<div class="gb_resLay"><div class="bdsharebuttonbox"><ul class="gb_resItms"><li><a title="分享到微信" href="#" class="bds_weixin" data-cmd="weixin" th:attr="rowkey=${n.rowkey}"></a></li><li><a title="分享到QQ好友" href="#" class="bds_sqq" data-cmd="sqq" th:attr="rowkey=${n.rowkey}"></a></li><li><a title="分享到新浪微博" href="#" class="bds_tsina" data-cmd="tsina" th:attr="rowkey=${n.rowkey}"></a></li></ul></div>
</div>

Jquery

 var rowkey = "";//绑定所有分享按钮所在A标签的鼠标移入事件,从而获取动态ID$(function () {$(".bdsharebuttonbox a").mouseover(function () {rowkey = $(this).attr("rowkey");});});function SetShareUrl(cmd, config) {if (rowkey) {config.bdUrl = ""+$("#"+rowkey).attr("href");config.bdText= $("#"+rowkey).text();}return config;}//插件的配置部分,注意要记得设置onBeforeClick事件,主要用于获取动态的文章IDwindow._bd_share_config = {"common": {onBeforeClick: SetShareUrl, "bdSnsKey": {}, "bdMini": "2", "bdMiniList": false, "bdPic": ".jpg", "bdStyle": "0", "bdSize": "24"}, "share": {}};//插件的JS加载部分with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = '.js?v=89860593.js?cdnversion='+ ~(-new Date() / 36e5)];

本文标签: PC端分享微信QQ微博