开发者

Capturing keyboard shortcuts in an iframe: focusing?

I'm creating an IFrame to house an app that wants to listen to keypress events -- is there any way to give this iframe focus, so keypresses get passed to its own handlers, and not to the main p开发者_StackOverflow社区age's? (Clicking within the iframe works, but makes for an awful user-interface...)

Thanks!

-B


calling focus on the iframe itself does the trick. E.g. in jquery:

$("#MyIFrame").focus()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜