检测重点是浏览器地址栏? [英] Detect focus on browser address bar?

查看:111
本文介绍了检测重点是浏览器地址栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检测何时将焦点放在地址栏或浏览器搜索栏上?

Is there a way to detect when focus has been put onto the address-bar or the browser-search-bar?

我问,因为我试图保持专注于我的文档中的一个元素,但为该元素添加 blur()侦听器(调用 focus()在同一个元素上)在 Safari Mac中运行得很好 - 你可以'当setFocus的超时为0时(插件需要),将焦点放在地址栏上。

I ask because I am trying to keep focus on one element in my document, but adding a blur() listener to that element (which calls focus() on that same element) works too well in Safari Mac -- you can't put focus on the address-bar when you setFocus with a timeout of 0 (necessary for a plugin).

推荐答案

不,这是不可能的

这篇关于检测重点是浏览器地址栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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