解决方案:
1:利用contentWindow,直接使用jquery的blur和focus,如果使用原生,加一个浏览器判断然后attachEvent 和 addEventListener就行了 <!-- lang:js-->
$($('#frame')[0].contentWindow).blur(function(){})
$($('#frame')[0].contentWindow).focus(function(){})
2:setTimeout解决它 <!--lang:js-->
$('#target').focusout(function() {
setTimeout(function() {
$(this).focus();
}, 0);
});
为什么FF存在这种问题?其实在HTML标准中iframe是没有这些事件的,但是IE给加上了。在火狐下可以通过contentWindow这种方式来处理这种事件