右下角浮动 二维码
//函数
//config.width 二维宽度
//config.height 二维高度
//maxScreen 当屏幕宽度小于这个值时 不显示 二维码。
function qrcodeFloat(config){
if(config==null){config={};}
if(config.width==null){config.width=100;config.height=100;}
if(config.height==null){config.height=100;}
if(config.maxScreen==null){config.maxScreen=1000;}
if(config.message==null){config.message="扫码手机访问";}
//qrcode
document.write('<script src="http://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js" ><\/script>');
document.write('<style type="text/css">#qrocdeContainer{position: fixed;z-index: 999;bottom: 0;left: 0;width: 100%;width:100%;}#qrcodeMessage{background:#fff;width:'+config.width+'px;padding:8px;text-align:center;float:right;}@media screen and (max-width: '+config.maxScreen+'px) {#qrocdeContainer{display:none;}}</style>')
document.write('<div id="qrocdeContainer"><div id="qrcodeMessage"><div id="qrcode"></div><div>'+config.message+'</div></div></div>')
$(function(){var content=document.location.href; jQuery('#qrcode').qrcode({width:config.width,height:config.height,correctLevel:0,text:content});});
}
//调用方法:
qrcodeFloat({width:120,height:120});
效果图: