在线货物追踪系统(
http://huayou.vicp.cc)在设计时,我用了1024×768的
分辨率,结果很多客户还是800×600的
分辨率,这样,不仅广告会占用位置(不过单击就关闭了),并且"报价服务"和"货物追踪"的下拉列表会忽前忽后.在网上搜了一段时间,大多都是用替换文件的方法来实现的,但我这里是在每个JSP文件中用
jsp:include来实现的,必须在导航文件中解决问题.
解决思路是:用javascript来输入层的CSS,只需动态的改变left的值即可,简单吧,还让自己忙了那么久!
...
<style type="text/css">
<!--
body {
margin-top: 0px;
background-image: url(img/logoback.gif);
background-color: #999999;
}
-->
</style>
<script type="text/JavaScript">
document.write('<style type="text/css">');
document.write('#s1024 {');
document.write('position:absolute;');
document.write('left:');
document.write(455-(1024-screen.width)/2);
document.write('px;');
document.write('top:143px;');
document.write('width:82px;');
document.write('height:63px;');
document.write('z-index:1;');
document.write('background-color: #0C01D1;');
document.write('visibility: hidden;');
document.write('}');
document.write('#t1024 {');
document.write('position:absolute;');
document.write('left:');
document.write(525-(1024-screen.width)/2);
document.write('px;');
document.write('top:142px;');
document.write('width:92px;');
document.write('height:43px;');
document.write('z-index:2;');
document.write('background-color: #0C01D1;');
document.write('visibility: hidden;');
document.write('}</style>');
</script>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
<div id="s1024">
<table width="80" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" background="img/tb.gif" class="daohang1"><a href="airprice.jsp"> 空运报价</a></td>
</tr>
<tr>
<td height="1" bgcolor="#FFFFFF" ></td>
</tr>
<tr>
<td height="20" background="img/tb.gif" class="daohang1"><a href="expressprice.jsp"> 快递报价</a></td>
</tr>
<tr>
<td height="1" bgcolor="#FFFFFF" ></td>
</tr>
<tr>
<td height="20" background="img/tb.gif" class="daohang1"><a href="takedelivery.jsp"> 香港派送费</a></td>
</tr>
</table>
</div>
<div id="t1024">
<table width="90" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" background="img/tb.gif" class="daohang1"> <a href="airtracke.jsp">空运追踪</a></td>
</tr>
<tr>
<td height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td height="20" background="img/tb.gif" class="daohang1"> <a href="customer.jsp">中港快递追踪</a></td>
</tr>
</table>
</div>
.
.
.
<a href="netorder.jsp">网上订单</a> | <a href="#" οnclick="MM_showHideLayers('s1024','','show','t1024','','hide')">服务报价</a> |
<a href="#" οnclick="MM_showHideLayers('s1024','','hide','t1024','','show')">货物追踪</a>