malsup / cycle2

2nd gen cycling
899 stars 239 forks source link

Managing cycle pause/resume state via Page Visibility API #803

Closed cantsdmr closed 6 years ago

cantsdmr commented 7 years ago

Hi, I looked for a feature that manages the cycle state according to Page Visibility API, but I didn't find out anything . When a user navigates other tab from actual tab, cycle state should be changed to paused. I think, we can manage this situation via data attribute or cycle-cmd at least. Would it be better to manage cycle state when the browser tab is active or inactive? Additional info : https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

Funny video demo: http://www.samdutton.com/pageVisibility/