当前位置: 代码迷 >> Web前端 >> 展示和隐藏frame
  详细解决方案

展示和隐藏frame

热度:393   发布时间:2012-09-12 09:21:30.0
显示和隐藏frame
<%@ page contentType="text/html; charset=UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>分隔栏</title>
<link rel="stylesheet" type="text/css" href="../style/icode.css" />
<script language="JavaScript">
function Submit_onclick(){
	if(parent.myFrame.cols == "200,6,*") {
		parent.myFrame.cols="0,6,*";
		document.getElementById("ImgArrow").src="../images/arrow_r.gif";
		document.getElementById("ImgArrow").alt="打开左侧导航栏";
	} else {
		parent.myFrame.cols="200,6,*";//200,6,*都代表的是宽度
		document.getElementById("ImgArrow").src="../images/arrow_l.gif";
		document.getElementById("ImgArrow").alt="隐藏左侧导航栏";
	}
}

function MyLoad() {
	if(window.parent.location.href.indexOf("MainUrl")>0) {
		window.top.leftFrame.document.getElementById("ImgArrow").src="../images/arrow_l.gif";
	}
}
</script>
<style>
html {
	width: 100%;
	height: 100%;
}

body {
	width: 100%;
	height: 100%;
}

#switchbody {
	background-color: #DFE8F0;;
	height: 100%;
	width: 100%;
	margin: 0;
	padding: 0;
}

#switchpic {
	width: 6px;
	cursor: pointer;
	vertical-align: bottom;
	margin-top: 220px;
}
</style>
</head>

<body id="switchbody" onload="MyLoad()">
<div id="switchpic"><a href="javascript:Submit_onclick()"><img
	src="../images/arrow_l.gif" alt="隐藏左侧导航栏" name="ImgArrow" border="0"
	id="ImgArrow" /></a>e<span class="style1">r</span></div>
</body>
</html>

?

  相关解决方案