Auto play stops when switching tabs
Closed this issue · 2 comments
I am working on a new site for our company and the AnythingSlider is working well for us, but we have noticed something I have not seen mentioned anywhere else.
We have an autoplay slider at the top of our page that when you switch to a different tab in Chrome or FF the animation stops. (see b2b.hitchfinderstores.com for our development page)
Is this expected? If so, is there some way to change this behavior?
Thanks!
Hi!
Actually yes, the plugin uses the javascript page visibility api to stop the slide show when the browser loses focus (code reference). This was done to reduce the amount of processing that is done in the background when content is not visible. It might not be a big deal now since mobile devices are much more powerful and most browsers now automatically increase the time intervals in hidden tabs (ref: Firefox & Chrome).
Anyway, to get around this, set the autoPlayLocked
option to true
.
Great! Thanks!