回 帖 发 新 帖 刷新版面

主题:[原创][分享]可以打开或关闭左边的框架网页

演示效果:
[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="&lt;" 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">&nbsp;</td>
    </tr>
</table>
</body>
</html>
[/quote]

回复列表 (共1个回复)

沙发

[b]再来一个只有左右两边没有顶部的效果[/b]

演示地址:
[url]http://www.lxasp.com/_DEMO/framemenu/index.htm[/url]

框架页代码:
[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>只有左右两边没有顶部</title>
</head>

<frameset cols="160,10,*" frameborder="no" border="0" framespacing="0">
    <frame src="left.htm" name="left" scrolling="yes" noresize="noresize" id="left" />
    <frame src="mid.htm" name="mid" scrolling="no" noresize="noresize" id="mid" />
    <frame src="main.htm" name="main" scrolling="yes" noresize="noresize" id="main" />
</frameset>
<noframes><body>
</body>
</noframes></html>
[/quote]

中间的按钮页面:
[quote]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>o</title>
<style type="text/css">
<!--
body {margin:0px;font-size:12px;}
-->
</style>
<script language='javaScript' type='text/javaScript'>
var displayBar=true;
function switchBar(o) {
    if (displayBar) {
        parent.document.getElementById("left").parentNode.cols="0,10,*";
        displayBar=false;
        o.value=">"
    } else {
        parent.document.getElementById("left").parentNode.cols="160,10,*";
        displayBar=true;
        o.value="<"
    }
}
</script>
</head>

<body>
<input type="button" onclick="switchBar(this);this.blur();" value="&lt;" title="打开或关闭左边框架" style="background:url(swtbar.gif) #EEEEEE;border:none;color:#666666;height:100%;width:10px;background-repeat:repeat-y">
</body>
</html>
[/quote]

我来回复

您尚未登录,请登录后再回复。点此登录或注册