<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>frame-study</title>
</head>
<frameset id="aaa" cols="40%,*" framespacing="0" frameborder="yes" border="2" >
<frame name="aFrame" src="a.html">
<frame name="bFrame" src="b.html" >
</frameset><noframes></noframes>
</html>
a.html
<!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=utf-8" />
<title>A</title>
</head>
<body style="background-color:#CCCCCC; >
<div>
<a href="2级联动.html" target="bFrame">AAAA</a><br />
<a href="" target="bFrame">AAAA</a><br />
</div>
</body>
</html>
b.html
<!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=utf-8" />
<title>B</title>
</head>
<body style="background-color:#9999FF">
BB<br />
<input type="button" onclick="test()" value="closeLeft" />
<script type="text/javascript">
var frameSeperated = true;
function test(){
var o = parent.document.getElementById('aaa');
if(frameSeperated){
o.cols = 0+"%,*";
frameSeperated = false;
}else{
o.cols = 40+"%,*";
frameSeperated = true;
}
}
</script>
</body>
</html>