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

关于frame和focus的问题
如果一个画面中有多个frame的话,按Tab键,focus会根据tabindex逐个往下跳,有没有办法让focus在跳完一个frame之后,重新回到该frame头部,而不是下一个frame。

就是说一个画面中有a   frame和b   frame,有没有办法在按Tab的时候,focus永远在a里面或者在b里面,而不是a跳完就跳到b这样的

------解决方案--------------------
<form method= "POST " action>
<input type= "text " name= "T1 " size= "20 ">
</form>
<iframe id=ifr1 width=100% height=50 onfocus= "ifr1.document.all.T2.focus() "> </iframe>
<iframe id=ifr2 width=100% height=50 onfocus= "ifr2.document.all.T4.focus() "> </iframe>
<script>
ifr1.document.write ( ' <input type= "text " name= "T2 " size= "20 " > <input type= "text " name= "T3 " size= "20 " > ');
ifr2.document.write ( ' <input type= "text " name= "T4 " size= "20 " > <input type= "text " name= "T5 " size= "20 " > ');

</script>

------解决方案--------------------
sorry,好像不行,是ie的问题,可以考虑一下是否能通过脚本控制
------解决方案--------------------
onfocus对iframe似乎不起效
------解决方案--------------------
想不通这个有什么用途?
------解决方案--------------------
天才的问题
------解决方案--------------------
好像不可以吧