如何令论坛右侧的微信扫一扫二维码在电脑高于1024分辨率才显示,否则不显示这样用户体验好一些,请大侠帮忙修改下代码,谢谢!如图:

- <!--{block return}-->
- <!--{if $_G['basescript'] != 'userapp' && empty($_G['cookie']['wechatfqrc'])}-->
- <div id="wechat_float_qrcode" class="p_pop xg1" style="display:none;text-align:center;float:left;position:fixed;top:220px;z-index:100;margin-left: 2px;width:110px">
- <p class="cl"><img class="y" style="cursor:pointer" onclick="display('wechat_float_qrcode');setcookie('wechatfqrc', 1, 86400)" src="{STATICURL}image/common/ad_close.gif"></p>
- <img src="plugin.php?id=wechat:qrcode{$idstr}&access=yes" width="98" />
- <p>{lang wechat:wsq_indexqr}</p>
- </div>
- <script>
- function wechat_qrcode(type) {
- if(type && $('wechat_float_qrcode').style.display == 'none') {
- return;
- }
- var qrleft = parseInt($('ft').clientWidth + parseInt(fetchOffset($('ft'))['left']));
- $('wechat_float_qrcode').style.display = '';
- if(qrleft + $('wechat_float_qrcode').clientWidth > document.documentElement.clientWidth) {
- $('wechat_float_qrcode').style.cssFloat = 'right';
- $('wechat_float_qrcode').style.left = 'auto';
- $('wechat_float_qrcode').style.right = 0;
- } else {
- $('wechat_float_qrcode').style.cssFloat = 'left';
- $('wechat_float_qrcode').style.left = (qrleft) + 'px';
- $('wechat_float_qrcode').style.right = 'auto';
- }
- }
- _attachEvent(window, 'scroll', function () { wechat_qrcode(1); })
- _attachEvent(window, 'load', function() { wechat_qrcode(0); }, document);
- </script>
- <!--{/if}-->
- <!--{/block}-->
复制代码 |