IPhone jQuery interrupts after starting email overlay

I am developing a mobile site for the iPhone using jQuery. I have a hidden div (class .tile-content) that contains some content. Clicking the link using onclick="showContent(this)"fadeIn calls as follows:

        function showContent(obj)
        {
            alert($(obj).html());
            $(obj).next('.tile-content').fadeIn();
            return false;
        }

Everything works fine until I touch "email us" on which there is a mailto link: on it, launching the iPhone, built-in email overlay functions. Then I hit and I returned to the site. Now, if I click the link, my .tile-contentdiv will not appear. However, I get a warning on the iPhone. After I click once, nothing works (which, I think, means there was a js error?). It's very hard to debug a physical iPhone. Any ideas?

Update: I turned on the Safari Mobile debugging console thanks to a tip from @John Boker below. No errors were found, but I still have the same problem.

+3
source share
3 answers

The problem occurs in the javascript setInterval / setTimeout functions. When you start the mail window in Safari on the iPhone, it seems that the internal timer used for these functions is pausing. After sending the email (or canceling the cancellation), the timer remains paused, and the setTimeout / setInterval functions do not work.

, setTimeout/setInterval, โ€‹โ€‹ jquery async, jquery setInterval , ( ).

url, "" "" , , . .

+2

settings -> safari -> developer -> debug console

javascript

+1

- fadeIn/fadeOut show/hide .

$(this).parent('.tile-content').hide();

, .

0
source

Source: https://habr.com/ru/post/1731481/


All Articles