malsup / cycle2

2nd gen cycling
899 stars 239 forks source link

Pictures disappear when tabbing browser when using jquery 3.1.0 #790

Open rotsen49 opened 7 years ago

rotsen49 commented 7 years ago

Just finished implementing jquery 3.1.0 and now when I tab to a new windows within any browser the pictures in my cycle2 temporarily disappear when I tab back to my running application (sometimes have to wait 4 to 6 seconds before they reappear) . This did not happen with jquery versions before 3.0.0.

You can visit www.starlightdemo.com to see the problem...just open a new tab in a browser and wait 10 seconds before tabbing back to starlightdemo.com.

JanValiska commented 7 years ago

Hello, same problem here. Try visit http://nova.linkadeti.sk

ghost commented 7 years ago

Just finished implementing jquery 3.1.0 and now when I tab to a new windows within any browser the pictures in my cycle2 temporarily disappear when I tab back to my running application.

I'm experiencing the exact same thing after implementing jquery 3.1.0.

rafhaelbarabas commented 7 years ago

Hey guys, i'm in the same problem.

How can i solve it?

using jquery 3.1.0.

TCB13 commented 7 years ago

I was using an older jQuery and it seems to also happen. Specially on OS X. On Windows seems like the slideshow gets paused until you return to the tab... Same issue reported at #777

TCB13 commented 7 years ago

Just found out this issue is present on jQuery version 2.2.4. Version 2.1.4 seems to be the last working one.

rafhaelbarabas commented 7 years ago

Can you tell me where i can get this version ? @TCB13

This is my issue -> http://screencast.com/t/aEcvN2nvwi (acess using a browser with Flash Compatibility, like Google Chrome)

TCB13 commented 7 years ago

@rafhaelbarabas I had the same issue as you. Download jQuery version 2.2.4. https://code.jquery.com/jquery/

rafhaelbarabas commented 7 years ago

Worked perfectly with 2.2.4 version!!!

Thank you for the help! @TCB13

wozniakm commented 7 years ago

Looks like in jQuery 2.2.4 DOM is frozen when tab is not focused, while on jQuery 3.1.0 it is still changing. Is there a way to pause slider when window is not focused? I need quick workaround.

// edit

There is my quick workaround if anyone still bother this problem.

jQuery(window).on('focus', function() { sliderContainer.cycle('resume'); }).on('blur', function() { sliderContainer.cycle('pause'); });

aaroncrawford commented 7 years ago

+1

zel777 commented 7 years ago

Nice fix @wozniakm! Works perfectly for me (running jQuery 3.1.1 and jQuery Migrate 1.4.1)

zachbharris commented 7 years ago

The quick workaround works great!