主题:[原创][分享]可以打开或关闭左边的框架网页
演示效果:
[img]http://www.lxasp.com/_DEMO/framemenu/Snap1.gif[/img]
框架页代码:
[quote]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>{=page_title}</title>
</head>
<frameset rows="32,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="Admin_Index.asp?top=1" name="top" id="top" scrolling="No" noresize="noresize" />
<frameset cols="160,*" frameborder="no" border="0" framespacing="0">
<frame src="Admin_FrameLeft.asp" name="left" id="left" scrolling="Yes"/>
<frame src="Admin_Welcome.asp" name="main" id="main" scrolling="Yes"/>
</frameset>
</frameset><noframes><body>
</body>
</noframes></html>
[/quote]
其中的顶部页面代码:
[quote]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="robots" content="noindex, nofollow" />
<title>框架页面顶部</title>
<style type="text/css">
* {font-size:12px}
body {margin:0px;}
</style>
<script language='javaScript' type='text/javaScript'>
var displayBar=true;
function switchBar(o) {
if (displayBar) {
parent.document.getElementById("left").parentNode.cols="0,*";
displayBar=false;
o.value=">"
} else {
parent.document.getElementById("left").parentNode.cols="160,*";
displayBar=true;
o.value="<"
}
}
</script>
<base target="main" />
</head>
<body>
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20">
<input type="button" onclick="switchBar(this);this.blur();" value="<" title="打开或关闭左边框架" style="background:none;border:1px solid #CCCCCC;color:#999999;height:31px;width:12px" />
</td>
<td>
<strong>顶部页面</strong> </td>
<td align="right">
<a href="./" target="_blank">浏览网站</a>
</td>
<td width="5"> </td>
</tr>
</table>
</body>
</html>
[/quote]
[img]http://www.lxasp.com/_DEMO/framemenu/Snap1.gif[/img]
框架页代码:
[quote]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>{=page_title}</title>
</head>
<frameset rows="32,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="Admin_Index.asp?top=1" name="top" id="top" scrolling="No" noresize="noresize" />
<frameset cols="160,*" frameborder="no" border="0" framespacing="0">
<frame src="Admin_FrameLeft.asp" name="left" id="left" scrolling="Yes"/>
<frame src="Admin_Welcome.asp" name="main" id="main" scrolling="Yes"/>
</frameset>
</frameset><noframes><body>
</body>
</noframes></html>
[/quote]
其中的顶部页面代码:
[quote]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="robots" content="noindex, nofollow" />
<title>框架页面顶部</title>
<style type="text/css">
* {font-size:12px}
body {margin:0px;}
</style>
<script language='javaScript' type='text/javaScript'>
var displayBar=true;
function switchBar(o) {
if (displayBar) {
parent.document.getElementById("left").parentNode.cols="0,*";
displayBar=false;
o.value=">"
} else {
parent.document.getElementById("left").parentNode.cols="160,*";
displayBar=true;
o.value="<"
}
}
</script>
<base target="main" />
</head>
<body>
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20">
<input type="button" onclick="switchBar(this);this.blur();" value="<" title="打开或关闭左边框架" style="background:none;border:1px solid #CCCCCC;color:#999999;height:31px;width:12px" />
</td>
<td>
<strong>顶部页面</strong> </td>
<td align="right">
<a href="./" target="_blank">浏览网站</a>
</td>
<td width="5"> </td>
</tr>
</table>
</body>
</html>
[/quote]