上、下两个分布的框架页面,通过js点击上frame改变下frame链接
1. index.html
<frameset rows="306,*" frameborder="no" border="0" framespacing="0">
<frame src="top.html" name="topList" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frame src="main.html" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>
<noframes>
<body>
</body>
</noframes>
2. top.html
<script langue="text/javascript">
function report(id){
var type = "stock";
if(id == '2'){
type = "fund";
}
top.mainFrame.location = "reportlist_2.jsp?type=" + type;//改变框架中的frame内容
document.getElementById("reportTit1").style.background="url(../images/0_21.jpg)";
document.getElementById("reportTit2").style.background="url(../images/0_21.jpg)";
document.getElementById("reportTit" + id).style.background="url(../images/0_20.jpg)";
document.getElementById("report1").style.display="none";
document.getElementById("report2").style.display="none";
document.getElementById("report" + id).style.display="block";
}
</script>
<div class="report">
<div class="reportTit">
<div id="reportTit1" onclick = "report(1);">股票透视日报</div>
<div id="reportTit2" onclick = "report(2);">基金透视日报</div>
</div>
</div>
3. main.html
具体内容显示