下载直接使用用javascript 将当前页面网址url 生成二维码<html><head> <base href="<%=basePath%>"> <title>二维码</title><meta http-equiv="pragma"content="no-cache"><meta http-equiv="cache-control"content="no-cache"><meta http-equiv="expires"content="0"> <meta http-equiv="keywords"content="keyword1,keyword2,keyword3"><meta http-equiv="description"content="二维码"><!--<link rel="stylesheet"type="text/css"href="styles.css">--><script type="text/javascript"src="js/jquery.js"></script><script type="text/javascript"src="js/qrcode.js"></script><script type="text/javascript"src="js/jquery.qrcode.js"></script><style> #fd { width:120px; height:120px; background:white; border: 1px solid black; margin-top:2px; margin-left:2px; float:left; overflow-y:auto; overflow-x:hidden; position:absolute; left:400px; /* bottom:260px; */ top:90px; cursor:move; float:left; } </style> </head><body> <br><div id="fd" style="display:none;filter:alpha(opacity=100);opacity:1;color:#849BCA;" > <div id="erweima" style="width: 120px; float: left;padding-left: 5px;padding-top:5px;"></div> <div style="float: right; padding-top: 50px; padding-right: 10px;"> <span>分 享 到</span> </br> <span>微 信 朋 友 圈</span> </div> </div> <div style="padding-top:200px;padding-left:500px;"><span><input type="button" id="btn" value="二维码" onclick = "show('fd');" /> </span></div><script type="text/javascript"> var prox; var proy; var proxc; var proyc; /*--打开--*/ function show(id) { btn.onclick = function(){closeed('fd');} btn.value = "二维码"; clearInterval(prox); clearInterval(proy); clearInterval(proxc); clearInterval(proyc); var o = document.getElementById(id); o.style.display = "block"; o.style.width = "1px"; o.style.height = "1px"; prox = setInterval(function(){openx(o,270)},0); /*--生成二维码 --*/ jQuery('#erweima').qrcode({ width:120, height:120,render : "canvas",text : document.URL}); /*--生成二维码 --*/ } /*--打开x--*/ function openx(o,x) { var cx = parseInt(o.style.width); if(cx < x) { o.style.width = (cx Math.ceil((x-cx)/5)) "px"; } else { clearInterval(prox); proy = setInterval(function(){openy(o,135)},0); } } /*--打开y--*/ function openy(o,y) { var cy = parseInt(o.style.height); if(cy < y) { o.style.height = (cy Math.ceil((y-cy)/5)) "px"; } else { clearInterval(proy); } } /*--关闭--*/ function closeed(id) { btn.onclick = function(){show('fd');} btn.value = "二维码"; clearInterval(prox); clearInterval(proy); clearInterval(proxc); clearInterval(proyc); var o = document.getElementById(id); if(o.style.display == "block") { proyc = setInterval(function(){closey(o)},0); } } /*--关闭y--*/ function closey(o) { var cy = parseInt(o.style.height); if(cy > 0) { o.style.height = (cy - Math.ceil(cy/5)) "px"; } else { clearInterval(proyc);proxc = setInterval(function(){closex(o)},0); } } /*--关闭x--*/ function closex(o) { var cx = parseInt(o.style.width); if(cx > 0) { o.style.width = (cx - Math.ceil(cx/5)) "px"; } else { clearInterval(proxc); o.style.display = "none"; $("#erweima").empty(); } } /*-------------------------鼠标拖动---------------------*/ /* var od = document.getElementById("fd"); var dx,dy,mx,my,mouseD; var odrag; var isIE = document.all ? true : false; document.onmousedown = function(e) { var e = e ? e : event; if(e.button == (document.all ? 1 : 0)) { mouseD = true; } } document.onmouseup = function() { mouseD = false; odrag = ""; if(isIE) { od.releaseCapture(); od.filters.alpha.opacity = 100; } else { window.releaseEvents(od.MOUSEMOVE); od.style.opacity = 1; } } od.onmousedown = function(e) { odrag = this; var e = e ? e : event; if(e.button == (document.all ? 1 : 0)) { mx = e.clientX; my = e.clientY; od.style.left = od.offsetLeft "px"; od.style.top = od.offsetTop "px"; if(isIE) { od.setCapture(); od.filters.alpha.opacity = 50; } else { window.captureEvents(Event.mousemove); od.style.opacity = 0.5; } } } document.onmousemove = function(e) { var e = e ? e : event; if(mouseD==true && odrag) { var mrx = e.clientX - mx; var mry = e.clientY - my; od.style.left = parseInt(od.style.left) mrx "px"; od.style.top = parseInt(od.style.top) mry "px"; mx = e.clientX; my = e.clientY; } } */ /*处理中文*/ function toUtf8(str) { var out, i, len, c; out = ""; len = str.length; for(i = 0; i < len; i ) { c = str.charCodeAt(i); if ((c >= 0x0001) && (c <= 0x007F)) { out = str.charAt(i); } else if (c > 0x07FF) { out = String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); out = String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); out = String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } else { out = String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); out = String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } } return out; } </script> </body></html>
下载jquery生成当前页面二维码功能分享微信用户还喜欢
- 18480 文章数
- 500万+ 热度
作者专栏
编辑推荐
- 淡抹u2引擎,修复内容较多,物有所值
- 界域传说·经典巨作=传世单机(一键安装)
- 丸子版本(175个传世版本大集合)
- GS版本:神话公益服务端+客户端
- 图片放大工具(放大图片不模糊)
- 剪映无限制VIP版
- 传奇世界客户端下载器,史上最全传世客户端
- 传世GS20220920商业引擎注册+登录配置器 解压密码是1
- U2官方排行榜游戏网关 支持元神,支持传家宝
- GS开战传世客户端+服务端
- (淡漠夕阳)u2引擎合区工具
- 传世GS引擎消除“你的游戏客户端版本号过旧,请及时更新”提示
- 传世一机多区双线路配置器--免密码版本
- 传世凤凰登陆器劫持修复软件
- SQLite3 for Navicat
- 传奇世界npc对话框编辑工具
- 传世GS落霞铭文服务器端
- gs_20210409引擎包+注册机(无限制)
- 传奇世界NPC对话封包查看器[支持时长版和极速版]
- 彩虹引擎传世脚本编辑工具1.7版来了,支持函数脚本翻译
评论