日期:2014-05-17  浏览次数:20613 次

Html三框架问题
Html框架导航分顶部和左部两部分(右窗为内容),其中点击顶部导航就出现左部导航(左导航为顶部导航的分类),我现在想如果点顶部导航时同时出现左部导航和右窗默认左部第一个链接的内容,HTML代码如下(导航类似如下系统:地址http://211.148.133.100/JHCRM/index.aspx
用户:admin   密码:328899)
<frameset   rows= "80,*,41 "   cols= "* "   frameborder= "no "   border= "0 "   framespacing= "0 ">

    <frame   src= "topFrame.html "   name= "topFrame "   scrolling= "No "   noresize= "noresize "   id= "topFrame "   title= "topFrame "   target= "leftFrame "   />
   
      <frameset   rows= "* "   cols= "89,* "   framespacing= "0 "   frameborder= "no "   border= "0 ">
          <frame   src= "leftFrame1.asp "   name= "leftFrame "   scrolling= "auto "   noresize= "noresize "   id= "leftFrame "   title= "leftFrame "   target= "mainFrame "   />
          <frame   src= "mainFrame.html "   scrolling= "auto "   id= "mainFrame "   name= "mainFrame "   target= "mainFrame ">
    </frameset>
     
   
    <frame   src= "bottomFrame.html "   scrolling= "no "   id= "bottomFrame "/>
</frameset>

------解决方案--------------------
顶部点击后 top.leftFrame.location.href= "left.asp ";
left.asp中
window.onload=function(){
top.mainFrame.location.href = "firstlink.asp "
}
------解决方案--------------------
可以用JS topFrame.html菜单内容大概这样

<script type= "text/javascript ">
function op(left,main){
var parF=parent.getElementsByTagName( "frameset ")[0].getElementsByTagName( "frameset ")[1];
var leftF=parF.getElementById( "leftFrame ");
var mainF=parF.getElementById( "mainFrame ");
leftF.src=left;
mainF.src=main;
}
</script>
<a href= "javascript:op( 'left1.htm ', 'main1.htm ') "> menu1 </a>
<a href= "javascript:op( 'left2.htm ', 'main2.htm ') "> menu2 </a>