FlexSlider icon indicating copy to clipboard operation
FlexSlider copied to clipboard

*PauseOnHover* before Flexslider Initialization

Open paulthecoder opened this issue 13 years ago • 0 comments

Lets say you have a "div" that will be the flexslider and it has dimensions of 400px x 200px. If a user hovers over the flexslider "div" before the initialization of the flexslider in javascript, once the flexslider loads and pauseOnHover is set to true the flexslider will not stop and continue to play. PauseOnHover will not work until a page refresh. It (sometimes) caused the slider to skip slides and behave in a buggy manner. So far I have tested this on Chrome and Safari and this occurs on v2.1 and 2.2 of flexslider.

A quick fix I did was using the callback API, the start() function. In my slider the arrow or (.flex-prev) element goes to position: left: 5px when the "div" flexslider is being hovered over (:hover). So what I do is when the flexslider initializes i check the position of .flex-prev and if it is equal to 5px, manually pause the slider. (slider.pause())

Here is the fiddle http://jsfiddle.net/paulthecoder/xtkbM/ . Press run and I have set a delay of three seconds using setTimeout for you to have enough time to hover your mouse over the flexslider "div" before it initializes. The flexslider should not pause even though your mouse is over the slider.

paulthecoder avatar Jul 26 '13 21:07 paulthecoder