price multiple是什么:网页制作问题,2 个框架怎么弄?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 01:08:59
大家先看下这个网页:

http://bbs.tech.tom.com/bbs.php?forumid=148&threadid=29299&page=1

点下靠左边的小三角,就可以把左边的页面收进去,这个代码是怎么做的?谢谢了

先建立框架页,主要代码如下:
<frameset cols="131,16,*" framespacing="0" frameborder="NO" border="0" id="mainFrameset">
<frame src="左边的页面" name="leftFrame" scrolling="yes" >
<frame scrolling=no noresize="true" name=toogle marginwidth=0 marginheight=0 src="bar.html">
<frame src="右边的页面" name="mainFrame" scrolling="yes">
</frameset>
</frameset>
**********************
bar.html 页面的代码如下:
<html>
<head>
<style type="text/css">
.o1 {background-color:#718BD6; font-size:10px; color:#ffffff; text-decoration:none;}
body {margin: 0px; background-color: #ffffff; }
</style>
<script language="javascript">
<!--
var iniCols, noCols, o_mf, o_ms, s, o_bt, ImageSrc;
function ini() {

o_mf = parent.document.getElementById("mainFrameset");
o_ms = document.getElementById("menuSwitch");
noCols = iniCols = o_mf.cols;
nn = document.getElementById('img1');
nnSrc = iniSrc = nn.src;
if ((pos = noCols.indexOf(",")) != -1) {
noCols = "0" + noCols.substring(pos);
}
if ((pos = nnSrc.indexOf("bbbb")) != -1) {
nnSrc = "asnew/u" + nnSrc.substring(pos);
}
s = false;

}
function changeLeft(){

s = !s;
o_mf.cols = s ? noCols : iniCols;
nn.src = s? nnSrc : iniSrc;
}

//-->
</script>
</head>
<body onload="ini()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="10" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="18" background="asnew/bar.gif"><a href="#"><img id="img1" src="asnew/bbbb.gif" width="18" height="8" alt="" onclick="javascript:changeLeft();" border="0"></a></td>
</tr>
</table>
</body></html>

***********
就可以实现了