当前位置:
首页 > 网站开发 > JavaScript教程 >
-
javascript实现网页分享至朋友圈功能
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <meta charset="UTF-8"> 6 <title></title> 7 <style type="text/css"> 8 #WX { 9 width: 231px; 10 height: 285px; 11 background: red; 12 padding: 10px; 13 background: #fff; 14 border: solid 1px #d8d8d8; 15 position: fixed; 16 top: 0; 17 left: 0; 18 right: 0; 19 bottom: 0; 20 margin: auto; 21 } 22 23 .bd_weixin_popup_head { 24 font-size: 12px; 25 font-weight: bold; 26 text-align: left; 27 line-height: 16px; 28 height: 16px; 29 position: absolute; 30 color: #000; 31 } 32 33 .bd_weixin_popup_head span { 34 font-size: 12px; 35 font-weight: bold; 36 text-align: left; 37 line-height: 16px; 38 } 39 40 .bd_weixin_popup_close { 41 width: 16px; 42 height: 16px; 43 text-decoration: none; 44 font-size: 16px; 45 text-align: right; 46 position: absolute; 47 right: 0; 48 top: 0; 49 cursor: pointer; 50 } 51 52 .bd_weixin_popup_foot { 53 font-size: 12px; 54 text-align: left; 55 line-height: 22px; 56 color: #666; 57 } 58 59 #weixin { 60 width: 185px; 61 height: auto; 62 margin: 10px auto; 63 } 64 </style> 65 </head> 66 67 <body> 68 <div id="WX"> 69 <div class="bd_weixin_popup_head"> 70 <span>分享到微信朋友圈</span> 71 <a class="bd_weixin_popup_close">×</a> 72 <div id="weixin"></div> 73 <div class="bd_weixin_popup_foot">打开微信,点击底部的“发现”,<br>使用“扫一扫”即可将网页分享至朋友圈。</div> 74 </div> 75 </div> 76 </body> 77 <script type='text/javascript' src='http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js'></script> 78 <script type="text/javascript" src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script> 79 <script type="text/javascript"> 80 var path = window.location.href;//获取页面的链接 81 $("#weixin").qrcode({ 82 text: path, //设置二维码内容 83 // render: "table", //设置渲染方式 84 width: 185, //设置宽度,默认生成的二维码大小是 256×256 85 height: 185, //设置高度 86 typeNumber: -1, //计算模式 87 background: "#ffffff", //背景颜色 88 foreground: "#000000" //前景颜色 89 }); 90 </script> 91 92 </html>
最新更新
swagger参数示例
asp+发送email
asp+语法介绍(六)----数据库篇
asp+语法介绍(五)----asp+的服务器端编程控
asp+语法介绍(四)----asp+的服务器端编程进
asp+语法介绍(三)----asp+的服务器端编程初
asp+语法介绍(二)---书写我们的第一个
asp+语法介绍(一)
亲密接触ASP.Net(16)
亲密接触ASP.Net(15)
【15天掌握SQLServer基础】-01 创建、修改
用 Access+Outlook 来采集信息
使用PowerDesigner生成Access数据库
让我们一起用开源数据库和开源框架废弃
随说秋色园从Access升迁到MSSQL过程
当爬虫被拒绝时(Access Denied)
Web API与OAuth:既生access token,何生refres
[认证 & 授权] 6. Permission Based Access Co
Access之C#连接Access
oracle 19c下载和安装教程(database和client)
细细品味ASP.NET (五)
细细品味ASP.NET (四)
细细品味ASP.NET (三)
细细品味ASP.NET (二)
细细品味ASP.NET (一)
在ASP.NET中访问Excel电子表格
有关ASP.NET的一些基本说明,解释
在ASP.NET中使用.NET组件
ASP.NET中密码保护,MD5和SHA1算法的使用
ASP.NET连SQL7接口源代码