2

我正在使用 jQuery 执行以下操作

$(window).bind("blur", function() {
    hasfocus = false;
  });

  $(window).bind("focus", function() {
    hasfocus = true;
  });

适用于 Chrome 和 FF,但不适用于 IE。当我单击 IE 窗口中的任何 html 元素时,会调用窗口模糊。

有没有人有同样的问题?

4

1 回答 1

2

在 Internet Explorer 8 中,您必须使用 eventsfocusoutfocusinondocument而不是window.

完整答案在这里:https ://stackoverflow.com/a/5556858/295687

于 2013-10-04T11:35:29.427 回答