日期:2014-05-18  浏览次数:20669 次

框架,特急!!!!!!
做了一个框架flash导航按键,分别  
index.html里的div名为main_div  
iframe_1.html里的div名为product_frame  
product-nokia.html里的div名为nokia  
现在想点击iframe_1联接后,框架刷新为product-nokia页面,而flash不变,现在问题是点了联接后,product-nokia无法在框架里显示,一闪就回到index.html了,  
代码如下:  

flash代码:  
on   (rollOver)   {  
if   (_root.link <> 3)   {  
this.gotoAndPlay( "s1 ");  
}  
}  
on   (releaseOutside,   rollOut)   {  
if   (_root.link <> 3)   {  
this.gotoAndPlay( "s2 ");  
}  
}  
on   (release)   {  
if   (_root.link <> 3)   {  
_root[ "item "+_root.link].gotoAndPlay( "s2 ");  
_root.link   =   3;  
outgoing_lc   =   new   LocalConnection();  
outgoing_lc.send( "lc_name ",   "methodToExecute ",   k=3);  
delete   outgoing_lc;  
}  
getURL( "iframe_2.html ",   "cont ");  
_root.button   =   1;  
}  

index.html代码:  
<iframe   name= "cont "   width= "1px "   height= "1px "   src= "iframe_0.html "   style= "display:none "   > </iframe>  
<div   id= "main_div "   style= "height:100%   ">  


iframe_1代码:  
function   load_content   ()   {  
if   (parent.document.getElementById( 'main_div '))   {  
parent.document.getElementById( 'main_div ').innerHTML=document.getElementById( 'product_frame ').innerHTML;  
}  
if   (!parent.document.getElementById( 'main_div '))   {  
window.location=( 'index.html ')   ;  
}  
}  
</script>  
</head>  
<body   onload= "load_content() ">  
<div   id= "product_frame "   style= "height:100%   ">  


product-nokia代码:  

function   load_content   ()   {  
if   (parent.document.getElementById( 'product_frame '))   {  
parent.document.getElementById( 'product_frame ').innerHTML=document.getElementById( 'nokia ').innerHTML;  
}  
if   (!parent.document.getElementById( 'product_frame '))   {  
window.location=( 'index.html ')   ;  
}  
}  
</head>  
<body   onload= "load_content() ">  
<div   class= "p2_text "   id= "nokia ">

------解决方案--------------------
能不能先将你各个页面的关系组织一下啊
------解决方案--------------------
uppp
------解决方案--------------------
up
------解决方案--------------------
学习一下。..
------解决方案--------------------
使用frameset的话,再利用IE的后退,刷新等功能确实有问题。
而且顺序还不唯一,跟IE加载页面的顺序有关。
实在不行回避frameset的用法,改用div或者使用jsp:include功能加载你的各个页面。
在总页面中使用table来实现frameset的分隔功能。