优秀的编程知识分享平台

网站首页 > 技术文章 正文

页面中含有分享功能使用加注意事项

nanyue 2024-09-12 16:02:50 技术文章 7 ℃

<div class="fenx bdsharebuttonbox">

<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>

<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到微博"></a>

<a href="#" class="bds_tqq" data-cmd="tqq" title="分享到qq"></a>

<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到qq空间"></a>

</div>

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到:","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};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)];</script>

自己做的分享的小图标覆盖掉功能自带的:

.fenx a{ display: inline-block; width: 25px; height: 25px !important;padding: 0 !important; margin: 0 10px 0 0 !important; float: left;}

.fenx a:nth-child(1){ background: url(./images/fenx_01.jpg) no-repeat;}

.fenx a:nth-child(2){ background: url(./images/fenx_02.jpg) no-repeat}

.fenx a:nth-child(3){ background: url(./images/fenx_03.jpg) no-repeat}

.fenx a:nth-child(4){ background: url(./images/fenx_04.jpg) no-repeat}

我使用的是 利用背景图覆盖掉

*注意:

当页面中有一个位置含有分享,可能整个页面的图片都有整个分享功能了,办法如下:

需要找到分享盒子的类名,然后用display=none 再加个优先级 隐藏掉,这样就完美。

.sr-bdimgshare{display:none!important;}

Tags:

最近发表
标签列表