[FlexSlider 2] How to fix the issue where the slider stops when the window loses focus
![[FlexSlider 2] How to fix the issue where the slider stops when the window loses focus](img/ogp.png)
Here's how to fix the issue where the slider stops when the window loses focus while displaying the jQuery slider plugin "FlexSlider 2" on a PC.
Sample of the stopping issue
Open it on a PC and try changing focus to a different window.
You'll notice it stops.
This seems to be a FlexSlider specification, but I'll show you how to prevent it from stopping.
Solution
To prevent the slider from stopping even when the window is not in focus
Around line 1145 of flexslider.js
Comment out the following code.
// Ensure the slider isn't focussed if the window loses focus.
$( window ).blur( function ( e ) {
focused = false;
}).focus( function ( e ) {
focused = true;
});
Like this:
// Ensure the slider isn't focussed if the window loses focus.
//$( window ).blur( function ( e ) {
// focused = false;
//}).focus( function ( e ) {
// focused = true;
//});
Here's an example with this applied; it should no longer stop.
If you cannot load the iframe correctly, click here.
Comments
We also welcome reports such as 'It worked!'




If this was helpful, we'd appreciate your support!
Any support received will be used for childcare.
Or support by buying something from the buttons below
(You don't have to buy the linked product.)
Amazon
楽天市場
Yahoo!ショッピング
PR