本文介绍了在jQuery中,focusin / focusout与focus / blur有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码使用处理一些事件:

I was handling some events using the following code with jQuery 1.7.2:

$().on('focus blur', function(event) {
  console.log(event.type);
});

我注意到 event.type 对于这两个事件,打印输出: focusin focusout

And I have noticed that event.type for both events, prints out: focusin and focusout.

focusin / focusout 焦点/模糊之间有什么区别?

推荐答案

简答: focusin     bubbles,焦点没有。

        focusout bubbles, blur  没有。

阅读:

Short answer: focusin    bubbles, focus does not.
        focusout bubbles, blur   does not.
Read the docs:

这篇关于在jQuery中,focusin / focusout与focus / blur有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 22:53