ie 中 iframe 获取 keydown 等按键事件问题 - 点滴记忆*记忆点滴
收藏本站

ie 中 iframe 获取 keydown 等按键事件问题

在iframe 的页面中定义了一个快捷键。但在firefox 中测试通过单在ie 中确无效。因为ie中iframe 页获取不的按键的焦点。

解决方法是在iframe 父页中调用:


$(document.getElementById('IFrameId')
    .contentWindow.document).keydown(
        function(){ alert('Key down!'); });



    留下足迹