要它显示不显示,不要它显示却显示,在线等代码

laoyue213 2005-04-11 09:49:52
效果如CCTV.com,如果分辨率为800×600则tableright层的内容不显示,其他则显示该层的内容。代码如下:
<script language="javascript">
if((window.screen.width == 800) && (window.screen.height == 600)){
document.getElementById("tableright").style.display="none";
}else{
document.getElementById("tableright").style.display="";
}
</script>
<div id=tableright style="display:none;Z-INDEX:1; LEFT:768px; WIDTH:200px; POSITION: absolute; TOP:0px; HEIGHT:8px">
123456789。。。。
</div>
请大家指导,马上揭帖!
...全文
57 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
TSD 2005-04-11
  • 打赏
  • 举报
回复
换个位置就可以了

<div id=tableright style="display:none;Z-INDEX:1; LEFT:768px; WIDTH:200px; POSITION: absolute; TOP:0px; HEIGHT:8px">
123456789。。。。
</div>
<script language="javascript">
if((window.screen.width == 800) && (window.screen.height == 600)){
document.getElementById("tableright").style.display="none";
}else{
document.getElementById("tableright").style.display="";
}
</script>
scoutlin 2005-04-11
  • 打赏
  • 举报
回复
倒过来写

<div id=tableright style="display:none;Z-INDEX:1; LEFT:768px; WIDTH:200px; POSITION: absolute; TOP:0px; HEIGHT:8px">
123456789。。。。
</div>
<script language="javascript">
if((window.screen.width == 800) && (window.screen.height == 600)){
document.getElementById("tableright").style.display="none";
}else{
document.getElementById("tableright").style.display="";
}
</script>

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧