SelectBox in Frame
[入库:2005年8月18日] [更新:2007年3月24日]
selectbox in frame(本页面已经包括在下载文件中了)
|
首先,建立frameset帧结构,为每个frame页面起名(红色部分):
<frameset cols="134,*" frameborder="0"> <frame src="nav.htm" scrolling="no" name="left"> <frame src="main.htm" name="right"> </frameset>
以上请自己调整适应自己的页面。
下面是左侧的页面nav.htm的代码:
<html> <head> <title></title> </head>
<script language="javascript"> <!-- function selectbox(indexbox) {
parent.right.location.href = document.selectform.select.options[indexbox].value; } //--> </script>
<body bgcolor="white">
<form name="selectform"> <div align="center"> <select onchange="selectbox(this.selectedindex);" size=6 name="select"> <option value="link1.htm">连接页面1 <option value="link2.htm">连接页面2 <option value="link3.htm">连接页面3 <option value="link4.htm">连接页面4 <option value="link5.htm">连接页面5 <option value="link6.htm">连接页面6 //一共6个连接页面,与上面的数字一致。 </select> </div> </form>
</body> </html>
右侧的页面随便。注意:颜色相同部分要一致。right是左侧的frame的名字啊。
如果不需要在frame中打开页面,用location替换parent.right.location.href 即可在全页面打开连接,当然不必再建立frameset了。 |
本文关键:java
本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)