woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.91k stars 1.69k forks source link

Flexslider stop moving when lost focus #1633

Closed Veecotech closed 2 months ago

Veecotech commented 7 years ago

Can anyone advise why the Flexslider will stop auto rotate whenever the browser is out of focus? E.g. when a new windows is opened on top of the website slider.

You may checked the slider in the demo(http://flexslider.woothemes.com) by open a notepad on top of the slider to notice it. The slider will stop moving.

I found one example which it is able to auto rotate even if the browsers is not in focus. – http://jsfiddle.net/paulthecoder/xtkbM/. I have checked the code and it seems to be very similar to the default flexslider code.

How do i make the slider auto rotate at all times? Appreciate if anyone could advise. Thanks.

FlamingPaw commented 7 years ago

I have been looking for a solution to this as well, and found a temporary fix that worked for me.

On lines 1088-1092 of jquery.flexslider.js there is a code block that checks for window focus. If the window is in focus, it sets the variable focused to true, and vice versa. dj0xq

On line 808 of the same file, the script checks the status of focused on order to decide if it should proceed to the next slide. gb8hz

What I did, is commented out the code block on lines 1088-1092, making the focused var is always true regardless of window focus. lbils

It would be nice to see this as a configuration option like the pauseOnAction and pauseOnHover options.