把三个Iframe加上target="name",然后点击的时候对应跳到三个name中去就行了

解决方案 »

  1.   

    上不了QQ,贴这儿吧共4个文件: u.html,1.html,2.html,3.htmlu.html:  <html>   
      <frameset   rows="*,*" >
      <frame   name=U   src="1.html">
      <frameset cols="*,*"   >     
       <frame   name=L   src="2.html">   
       <frame   name=R   src="3.html">
      </frameset>    
      </frameset>   
      </html>1.html:<html>   
      <head>   
      <script   language="Javascript">
    function   setbtn(){ 
             var htmlStr="";
             htmlStr+='<input type="button" name="btn2" value="music" onclick="setvalue(2);" >';
             htmlStr+='<input type="button" name="btn3" value="sport" onclick="setvalue(3);" >';
             htmlStr+='<input type="button" name="btn4" value="reading" onclick="setvalue(4);" >';
             
             var div = parent.L.document.getElementById('btnArea');
             div.innerHTML=htmlStr;
             }    
      </script>   
      </head>
    <body>  
     <input type="button" name="btn1" value="favorite" onclick="setbtn();">
    </body>
    </html>2.html:<html>   
      <head>   
      <script   language="Javascript">
      function   setvalue(i){ 
               if(i==2){
    var htmlStr='favorite:music';
                    var div = parent.R.document.getElementById('favArea');
                    div.innerHTML=htmlStr;
               } 
               if(i==3){
    var htmlStr='favorite:sport';
                    var div = parent.R.document.getElementById('favArea');
                    div.innerHTML=htmlStr;
               } 
       if(i==4){
    var htmlStr='favorite:reading';
                    var div = parent.R.document.getElementById('favArea');
                    div.innerHTML=htmlStr;
               } 
      }
      </script>
      </head>
      <body>
       <div id='btnArea'>
       
       <div>  
      </body>
    </html>     3.html:<body>
       <div id='favArea'>
       
       <div>  
    </body>