如何把网页导航和正文都在一个网页内?

来源:百度知道 编辑:UC知道 时间:2024/07/07 11:18:25
就像单击某个链接,显示一个层内的内容
点击其他链接,就隐藏上面的层,显示另一个
如此类推。
就像windows里面帮助提示那样,只是不想先点击那个“?”
<script>
function showMenu(){
document.getElementById("menu1").style.display="";
document.getElementById("menu1").focus();
}
function hideMenu(){
document.getElementById("menu1").style.display="none";
}
</script>
<a style="cursor:hand" onclick="showMenu();void(0);">Menu1</a> 
<a style="cursor:hand" onclick="showMenu();void(1);">Menu2</a> 
<a style="cursor:hand" onclick="showMenu();void(2);">Menu3</a> 
<a style="cursor:hand" onclick="showMenu();void(3);">Menu4</a> 
<div onblur="hideMenu();" style="border:#aabbcc 1px solid;padding:10px;display:none; height:300px;width:500;background

你用一下 下面的代码 看是你需要的吗
<html>
<head>
<title>隐藏层的打开关闭</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor=#FFFFFF >
<!-------------------------------->
<script language=javascript>
ie4=(document.all)?true:false;
ns4=(document.layers)?true:false;

function toExit(){
var args=toExit.arguments;
var visible=args[0];
if(ns4){
theObj=eval("document.layers[\'"+args[1]+"\']");
if(theObj)theObj.visibility=visible;
}
else if(ie4){
if(visible=='show')visible='visible';
if(visible=='hide')visible='hidden';
theObj=eval("document.all[\'"+args[1]+"\']");
if(theObj)theObj.style.visibility=visible;