简体   繁体   中英

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?

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. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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