网(LieHuo.Net)教程 关于论坛帖子右侧的广告显示问题,最近有朋友询问网,如果访客的分辨率小于1024,能否不显示呢?,下面就教你怎样把帖子右侧的广告设置成只有读者的电脑分辨率是超过1024的宽屏下显示。
教程如下:
打开templates/default/viewthread_node.htm
找到:
<!--{if
$admode && !empty($advlist['thread3'][$post['count']])}--><div
class=ad_pip
id=ad_thread3_$post[count]>$advlist[thread3][$post[count]]</div><!--{else}--><div
id=ad_thread3_$post[count]></div><!--{/if}--><div
id=ad_thread4_$post[count]></div>
改为:
<div id=Layer><!--{if $admode && !empty($advlist['thread3'][$post['count']])}--><div class=ad_pip id=ad_thread3_$post[count]>$advlist[thread3][$post[count]]</div><!--{else}--><div id=ad_thread3_$post[count]></div><!--{/if}--><div id=ad_thread4_$post[count]></div></div>
<script language=javascript>
var iWidth = window.screen.availWidth;
var iHeight = window.screen.availHeight;
if(iWidth>1024){
document.getElementById('Layer').style.display = '';
} else {
document.getElementById('Layer').style.display = 'none';
}
</script>
完。-网防采集。