简体   繁体   English

如何为 iPhone 上的文档触发 Blur 事件?

[英]How to get the Blur event to fire for the document on the iPhone?

Does anyone know how to get the blur event to fire on the document for the iPhone?有谁知道如何在 iPhone 的文档上触发模糊事件?

I'm trying to get it to fire either when a user changes windows in Safari, or when they open their bookmarks or when they decide to add the page to their homescreen.我试图让它在用户更改 Safari 中的窗口时、当他们打开书签时或当他们决定将页面添加到主屏幕时触发。 But none of these are firing it.但这些都没有发射它。

Here's my code:这是我的代码:

    $(document).blur( function () {                 
        document.title = "Ian Taylor";
    });

I've tried "document", "window", "'body'".我试过“文档”、“窗口”、“身体”。 Nothing seems to work.似乎没有任何效果。

According to quirksmode, Safari on the iPhone does not fire the "blur" event when the window loses focus.根据 quirksmode,当窗口失去焦点时,iPhone 上的 Safari 不会触发“模糊”事件。

http://www.quirksmode.org/dom/events/ http://www.quirksmode.org/dom/events/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM