KevinBatdorf / liquidslider

A Responsive jQuery Content Slider
161 stars 63 forks source link

Slider stops when I lose the focus on the browser #148

Closed kedare closed 9 years ago

kedare commented 10 years ago

Hello,

I try to setup a slider that will always slide, currently, it stops when I lose the focus on the browser window.

How to make it continue to slide ?

Here is my config :

$(function(){
    $('#slider-id').liquidSlider({
        dynamicTabsAlign: "center",
        keyboardNavigation: true,
        includeTitle: false,
        autoSlide: true,
        autoSlideDirection: "right",
        autoSlideInterval: 100,
        forceAutoSlide: true,
        pauseOnHover: false,
        continuous: true,
        slideEaseFunction: "easeInOutCubic",
    });
});

Thank you.

LingoSam commented 9 years ago

I am also having the same problem. The slider stops when the browser window is not focussed. I am using Chrome, but it appears to do it on all browsers.

I can't tell if that's just it's normal behaviour, or something the browser is doing.

KevinBatdorf commented 9 years ago

I designed it this way because when the browser loses focus in Chrome, it queues up the transitions. Then onces the tab regains focus, it runs them all at once. It creates a poor experience as it may transition from slide 3 to slide 7 in one swoop, which looks bad.

In what scenario would you want the transitions to continue when out of focus? You could easily write your own autoslide function, just check out how I wrote it.

kedare commented 9 years ago

In my case I'm using it in a Firefox in 'kiosk' to display our network Weathermap on secondary screens

KevinBatdorf commented 9 years ago

There's a function on line 1038 that you could modify, or you can try unregistering the blur event handler

jQuery(window).off('blur');