确保立即选择iframe [英] Make sure iframe is selected right away

查看:60
本文介绍了确保立即选择iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但是当我使用iframe时,如果单击框架,则某些方面(由iframe使用的html文件中的事件监听器控制)可用.如果您在iframe外部单击,则会失去对这些控件和事件侦听器的访问权限.有没有办法使 iframe已经被点击??不好意思,但我还没有找到一种方法来解决这个问题,

This is possibly a stupid question, but when I'm using an iframe, particular aspects (controlled by event listeners in the html file that is used by the iframe) are available if you click on the frame. If you click outside of the iframe it looses access to those controls and event listeners. Is there a way to make an iframe be already clicked?. Sorry about the bad wording, but I haven't found a single way to do this, any thoughts?

推荐答案

尝试:

iframe.onblur = function() {
  iframe.focus();
}

这篇关于确保立即选择iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆