bxslider-4
bxslider-4 copied to clipboard
Sliders stop when browser looses focus
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
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
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.
does anyone have solution on this? I have the same issue.
No it's still open.. Even if I did, it was loooong time ago.
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.
I know it is an old issue but with the 4.2 it works form me:
var myOnBlur = function() { myslider.startAuto(); }; $(window).blur(myOnBlur );
Thanks binzorellino, this js solution fix this bug.