<a href="javascript:" onclick="document.getElementById('mcover').style.display='block'">分享到朋友圈</a>
<div id="mcover" onclick="document.getElementById('mcover').style.display=''" style="display: none">
<img src="/public/images/guide.png">
</div>
对应样式如下:
#mcover {
position: fixed
top: 0
left: 0
width: 100%
height: 100%
background: rgba(0, 0, 0, 0.7)
display: none
z-index: 20000
}
#mcover img {
position: fixed
right: 18px
top: 5px
width: 260px
height: 180px
z-index: 999
}
<script language="javascript" type="text/javascript">function WeiXinShareBtn() {if (typeof WeixinJSBridge == "undefined") {
alert("请先通过微信搜索 ****添加****为好友,通过微信分享文章")
} else {
WeixinJSBridge.invoke('shareTimeline', { "title": "文章标题",
"link": "地址链接", "desc": "文章描述",
"img_url": "图片地址" })} }
</script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)