Jump to content
Search Community

Pause all timelines when page is not "focus" safari iOS

martis test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Heya,

 

I am running into an issue on one of my sites where when I navigate away (open a new tab) and come back to my tab my animations are out of sync. Does anyone know a way to detect if the user has navigated away, and navigated back? Tried blur and unload on window, but no luck...

Link to comment
Share on other sites

It worked when I first tested and made that codepen, which wasnt that long ago.. it works in Modern Browsers and mobile browsers.

 

But If you go to that codepen link I referenced above, you can test it on your IPhone or IPad you might have to open the pen in Full View.. just follow the short directions in the codepen, which is just simply focusing in and out by switching tabs and browser windows:

 

See the Pen sxgJl by jonathan (@jonathan) on CodePen

 

So it's best to test it on your devices.. Also I'm sure that some of the fine minds here who have looked at that codepen above can share how it behaved on their IPhone or IPad ;)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...