bxslider-4 icon indicating copy to clipboard operation
bxslider-4 copied to clipboard

Sliders stop when browser looses focus

Open compumatter opened this issue 8 years ago • 7 comments

Hello,

When I click away from the browser (loose focus) I notice the slider stops moving. Is this a built in functionality and how can I override this behavior?

Thanks.

Jay CompuMatter

compumatter avatar Jun 22 '16 23:06 compumatter

Hello, I found in initAuto function this piece of code: //add focus and blur events to ensure its running if timeout gets paused $(window).focus(function() { el.startAuto(); }).blur(function() { el.stopAuto(); }); The blur event is sent to an element when it loses focus, so stopAuto() will be executed. Simply you can comment el.stopAuto(); inside the handler function to prevent the slider stops moving when the browser looses focus. In my case I prevent that starting a video in a slider another slider stops moving. I'm testing this right now so I don't know if it can cause other issues.

amacgyver

amacgyver avatar Sep 01 '16 11:09 amacgyver

I have experienced the same issue. In my case it was iframe with slider. The slider is working only when it is focused. I you click on the page somewhere else - the slider stops.

kadiiskiFFW avatar Sep 19 '16 09:09 kadiiskiFFW

does anyone have solution on this? I have the same issue.

jaytolsimir avatar May 10 '18 14:05 jaytolsimir

No it's still open.. Even if I did, it was loooong time ago.

kadiiskiFFW avatar May 10 '18 17:05 kadiiskiFFW

I did resolve this issue by downgrading to 4.1.1 from 4.2.12. though im still looking for some other way to resolve this issue.

jaytolsimir avatar May 15 '18 06:05 jaytolsimir

I know it is an old issue but with the 4.2 it works form me:

var myOnBlur = function() { myslider.startAuto(); }; $(window).blur(myOnBlur );

binzorellino avatar Jan 05 '22 08:01 binzorellino

Thanks binzorellino, this js solution fix this bug.

piwanowitsch avatar Oct 05 '23 09:10 piwanowitsch