请教各位大虾:在网页中如何做到"使图层显示时兼顾800*600及1024*768分辨率",BTW:不要告诉我要做两个页面。谢谢,希望看到的朋友 帮着提提前。 (

  • 主题发起人 主题发起人 修缘
  • 开始时间 开始时间

修缘

Unregistered / Unconfirmed
GUEST, unregistred user!
请教各位大虾:在网页中如何做到"使图层显示时兼顾800*600及1024*768分辨率",BTW:不要告诉我要做两个页面。谢谢,希望看到的朋友 帮着提提前。 (100分)<br />如题!!!圣诞快到了,祝各位大侠们快乐!!!
 
两种分辨率各做一份。好象某个著名网站就是这样干的。
 
这样太烦了啊 我原来就是这么做的啊
但我看到有的网站上面显示的层做的菜单, 两种分辨率都行啊
谁来帮帮我???
 
你是不是用dreamwaver?
我以前是用它的layer,但后来全用表格了,layer不知什么原因会变形
呵呵,其实我很少做网页,见谅,权当提前^_^
 
谢谢lsj
我是用dreamwaver的layer是用来做DropMenu 可是要兼顾两种分辨率啊
以前我是两种分辨率各做一份。可有的网站不是这样的啊?不知道他们是如何实现的??
有谁肯帮助我????
 
用层的话一个页面是不可能适应两种分辨率的,除非你用JS控制,不过这又太过麻烦,还没做两个页面来的舒服。
BTW:为什么非要用层呢?用表格多好?设置宽度为相对宽度就能轻易适应各种分辨率了。尽量少用层!
 
To:Oracle815
我就是想知道用JS如何控制啊???
 
还没有发现更好的办法,好像只有做两个页面或者写JS来控制
 
呵呵 算你运气好 我也碰到过类似问题
解决方法如下:
1、取得该层在800*600的 L、T、W、H值,
(L是指Left值,T是指Top值,W是指宽度值,H是高度值)
2、取得该层在1024*768的 L、T、W、H值,
(同上)
3、写一判断分辨率的JAVASCRIPT的小程序然后在不同的分辨率设置不同的L、T、W、H值
GOOD LUCK!!!
 
补充一句 其实在两种分辨下 变的只是Left的值 不信你在两种分辨率下 试试
 
很简单,用%来做,比如 <table width=80%>
那这样在任何一种分辨率下都占屏幕的80%
 
层也一样么????好像不对阿!!!
 
dreaware可以控制的,把表格或层的比例设置成100%就行了,
不要设定宽度,它就可以自适应了,要多大有多大,要多小有多小。
 
贴段菜单的javascript程序给你看看
算出菜单的大约宽度,一个个加上去
如:<td width=85
<div id=Layer9 style=position:absolute;left:325px《--这里加上去
<html>
<head>
<meta http-equiv=Content-Language content=zh-cn>
<LINK href=style1.css rel=stylesheet type=text/css>
<!--style start-->
<STYLE type=text/css>FONT {
FONT-SIZE: 9pt;
LINE-HEIGHT: 15pt;
TEXT-DECORATION: none;
A{text-transform: none
}
.hand {
BACKGROUND-COLOR: rgb(239,225,182);
CURSOR: hand
}
</STYLE>
<!--style end-->
<meta http-equiv=Content-Type content=text/html;charset=gb2312>
<meta name=GENERATOR content="Microsoft FrontPage 4.0">
<meta name=ProgId content=FrontPage.Editor.Document>
<title>福安在线</title>
<script language=JavaScript>
<!--
function MM_findObj(n, d){//v4.0
var p,i,x;
if(!d) d=document;
if((p=n.indexOf("?"))>0&amp;&amp;parent.frames.length){
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n];
for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x &amp;&amp;
document.getElementById) x=document.getElementById(n);
return x;
}
function MM_showHideLayers(){//v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0;
i<(args.length-2);
i+=3) if ((obj=MM_findObj(args))!=null){v=args[i+2];
if (obj.style){obj=obj.style;
v=(v=='show')?'visible':(v='hide')?'hidden':v;}
obj.visibility=v;}
}
function MM_reloadPage(init){//reloads the window if Nav4 resized
if (init==true) with (navigator){if ((appName=="Netscape")&amp;&amp;(parseInt(appVersion)==4)){
document.MM_pgW=innerWidth;
document.MM_pgH=innerHeight;
onresize=MM_reloadPage;}}
else
if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table border=0 cellpadding=0 cellspacing=0 width=770 align=center>
<tr>
<td height=0>
<center>
</center>
<div align=center>
<center>
<table width=770 border=0 bgcolor=#0066cc>
<tr>
<td width=70 align=middle> <font color=#FFFFFF>ㄧ<a class=bar a href=#>首页</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer1','','show')" onMouseOut="MM_showHideLayers('Layer1','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>市情综述</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer2','','show')" onMouseOut="MM_showHideLayers('Layer2','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>政府之窗</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer3','','show')" onMouseOut="MM_showHideLayers('Layer3','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>商务经济</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer4','','show')" onMouseOut="MM_showHideLayers('Layer4','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>宣传专线</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer5','','show')" onMouseOut="MM_showHideLayers('Layer5','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>家乡风情</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer6','','show')" onMouseOut="MM_showHideLayers('Layer6','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>福安图片</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer7','','show')" onMouseOut="MM_showHideLayers('Layer7','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>福安社区</a>ㄧ</font>
<td width=85 onMouseOver="MM_showHideLayers('Layer8','','show')" onMouseOut="MM_showHideLayers('Layer8','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>人才信息</a>ㄧ</font>
<td width=70 onMouseOver="MM_showHideLayers('Layer9','','show')" onMouseOut="MM_showHideLayers('Layer9','','hide')" align=middle><font color=#FFFFFF>ㄧ<a class=bar a href=#>其他</a>ㄧ</font>
</table>
</center>
</div>
<div id=Layer10 style=position:absolute;width:170px;height:150px;z-index:8>
<div id=Layer1 style=position:absolute;left:70px;top:-2px;width:85px;height:100px;z-index:1;visibility:hidden onMouseOver="MM_showHideLayers('Layer1','','show')" onMouseOut="MM_showHideLayers('Layer1','','hide')">
<table width=85 cellspacing=0 cellpadding=0 height=100 bgcolor=#0066cc>
<tr>
<td width=85 height=100 align=middle><font color=#FFFFFF> <a class=bar a href=#>地理概貌</a><br>
<a class=bar a href=#>行政区划</a><br>
<a class=bar a href=#>历史沿革</a><br>
<a class=bar a href=#>经济状况</a><br>
<a class=bar a href=#>山海资源</a></font></td>
</table>
</div>
<div id=Layer2 style=position:absolute;left:155px;top:-2px;width:85px;height:80px;z-index:2;visibility:hidden onMouseOver="MM_showHideLayers('Layer2','','show')" onMouseOut="MM_showHideLayers('Layer2','','hide')">
<table width=85 cellspacing=0 cellpadding=0 height=80 bgcolor=0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href=#>大政方针</a><br>
<a class=bar a href=#>机关效能</a><br>
<a class=bar a href=#>群众之声</a><br>
<a class=bar a href=#>投资指南</a><br>
<a class=bar a href=#>政务联络</a></font></td>
</tr>
</table>
</div>
<div id=Layer3 style=position:absolute;left:240px;top:-2px;width:85px;height:1px;z-index:3;visibility:hidden onMouseOut="MM_showHideLayers('Layer3','','hide')" onMouseOver="MM_showHideLayers('Layer3','','show')">
<table width=85 cellspacing=0 cellpadding=0 align=center height=100 bgcolor=#0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href="agri/ziyuan.html" target=_blank>电机电器</a><br>
<a class=bar a href="agri/nongye.html" target=_blank>船舶修造</a><br>
<a class=bar a href="agri/keji.html" target=_blank>石材加工</a><br>
<a class=bar a href="agri/head.html" target=_blank>水产养殖</a><br>
<a class=bar a href="agri/head.html" target=_blank>名优特产</a><br>
<a class=bar a href="arti/hot.html" target=_blank>供求信息</a></font></td>
</tr>
</table>
</div>
<div id=Layer4 style=position:absolute;left:325px;top:-2px;width:85px;height:1px;z-index:4;visibility:hidden onMouseOut="MM_showHideLayers('Layer4','','hide')" onMouseOver="MM_showHideLayers('Layer4','','show')">
<table width=85 cellspacing=0 cellpadding=0 align=center height=40 bgcolor=#0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href=#>宣传概况</a><br>
<a class=bar a href=#>领导论坛</a><br>
<a class=bar a href=#>理论园地</a><br>
<a class=bar a href=#>阵地建设</a><br>
<a class=bar a href=#>福安文艺</a></font></td>
</tr>
</table>
</div>
<div id=Layer5 style=position:absolute;left:410px;top:-2px;width:85px;height:1px;z-index:5;visibility:hidden onMouseOut="MM_showHideLayers('Layer5','','hide')" onMouseOver="MM_showHideLayers('Layer5','','show')">
<table width=85 cellspacing=0 cellpadding=0 align=center height=40 bgcolor=#0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href=#>人文荟萃 </a><br>
<a class=bar a href=#>民俗风情</a><br>
<a class=bar a href=#>名胜古迹</a><br>
<a class=bar a href=#>特色文化</a><br>
<a class=bar a href=#>历史传说</a></font></td>
</tr>
</table>
</div>
<div id=Layer6 style=position:absolute;left:495px;top:-2px;width:85px;height:1px;z-index:6;visibility:hidden onMouseOut="MM_showHideLayers('Layer6','','hide')" onMouseOver="MM_showHideLayers('Layer6','','show')">
<table width=85 cellspacing=0 cellpadding=0 align=center height=40 bgcolor=#0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href=#>城市新貌 </a><br>
<a class=bar a href=#>基础设施</a><br>
<a class=bar a href=#>人物风采</a><br>
<a class=bar a href=#>风光物产</a><br>
<a class=bar a href=#>社会生活</a></font></td>
</tr>
</table>
</div>
<div id=Layer7 style=position:absolute;left:580px;top:-2px;width:85px;height:1px;z-index:6;visibility:hidden onMouseOut="MM_showHideLayers('Layer7','','hide')" onMouseOver="MM_showHideLayers('Layer7','','show')">
<table width=85 cellspacing=0 cellpadding=0 align=center height=40 bgcolor=#0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href=#>社区论坛 </a><br>
<a class=bar a href=#>聊 天</a><br>
<a class=bar a href=#>交 友</a><br>
<a class=bar a href=#>游 戏</a></font></td>
</tr>

</table>
</div>
<div id=Layer8 style=position:absolute;left:325px;top:-2px;width:85px;height:1px;z-index:4;visibility:hidden onMouseOut="MM_showHideLayers('Layer4','','hide')" onMouseOver="MM_showHideLayers('Layer4','','show')">
<table width=85 cellspacing=0 cellpadding=0 align=center height=40 bgcolor=#0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href=#>宣传概况</a><br>
<a class=bar a href=#>领导论坛</a><br>
<a class=bar a href=#>理论园地</a><br>
<a class=bar a href=#>阵地建设</a><br>
<a class=bar a href=#>福安文艺</a></font></td>
</tr>
</table>
</div>
<div id=Layer9 style=position:absolute;left:325px;top:-2px;width:85px;height:1px;z-index:4;visibility:hidden onMouseOut="MM_showHideLayers('Layer4','','hide')" onMouseOver="MM_showHideLayers('Layer4','','show')">
<table width=85 cellspacing=0 cellpadding=0 align=center height=40 bgcolor=#0066cc>
<tr>
<td width=85 height=20 align=middle><font color=#FFFFFF> <a class=bar a href=#>宣传概况</a><br>
<a class=bar a href=#>领导论坛</a><br>
<a class=bar a href=#>理论园地</a><br>
<a class=bar a href=#>阵地建设</a><br>
<a class=bar a href=#>福安文艺</a></font></td>
</tr>
</table>
</div>
</div>
</table>
</body>
</html>
 
TO:山泉
这是我原来采用的控制方法 但在两种分辨率下不行啊
 
Up
踢一脚
 
dreamweaver进行设计好象不用考虑分辨率吧
 
算了 接受答案了
 
后退
顶部