这个效果实现的是,在B页面里有两个层,一个显示层,我们暂定名c层,一个是隐藏层,我们暂定名d层,单独进B页面的时候,c层显示,d层隐藏,然而从A页面连接到B页面的时候,则是让d层显示,c层隐藏,我觉得这个效果对网页设计者以后会有很大帮助,现在把代码发出来,这里感谢经典的老二提供技术帮助。
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/) !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
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


