这个效果实现的是,在B页面里有两个层,一个显示层,我们暂定名c层,一个是隐藏层,我们暂定名d层,单独进B页面的时候,c层显示,d层隐藏,然而从A页面连接到B页面的时候,则是让d层显示,c层隐藏,我觉得这个效果对网页设计者以后会有很大帮助,现在把代码发出来,这里感谢经典的“老二”提供技术帮助。
A页面:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>这是A页面</title></head><body><a href="B.htm?id=show">我要连到B页面</a></body></html>
B页面:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>这是B页面</title><script language="javascript">function show(){var a=document.location.href;//alert(a);if(a.indexOf("id=show")==-1){document.getElementById("hidden").style.display="none";document.getElementById("show").style.display="block";}else{document.getElementById("hidden").style.display="block";document.getElementById("show").style.display="none";}}</script></head><body onload="show()"><div id="hidden" style="display:none "><font color="red">这里是一个隐藏的层,把我显示出来吧,最好显示我的时候把下面的那个层隐藏掉</font></div><div id="show"><font color="blue">这是一个显示的层</font></div></body></html>
推荐阅读
从四个方面谈谈Web标准的价值所在
清清楚楚的明白Web标准的价值!Web标准的价值相信没人会不知道,不理睬。可是具体能做什么,能不能很好的作为一个规范或者指标去诊断网站存在的问题,能不能列出一张清单,清清楚楚地看到它的价值呢?
>>>详细阅读
本文标题:从A页面连接到B页面后并直接把B页面的隐藏层显示
地址:http://www.17bianji.com/kaifa2/CSS/17190.html
1/2 1