woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.92k stars 1.7k forks source link

`after` callback fires on touch down in touch devices. #1638

Open AnupamKhosla opened 7 years ago

AnupamKhosla commented 7 years ago

I had a code in after callback. This code runs when I tap on main slider image. The bug occurs on first tap only, for further taps after callback doesn't run.

I have been using two sync sliders as:

// The slider being synced must be initialized first
            $('#flex-carousel-H').flexslider({
                animation: "slide",
                controlNav: false,
                animationLoop: false,
                slideshow: false,
                itemWidth: 320,
                itemMargin: itemMargin,
                touch: true,
                maxItems: gridSize,
                minItems: gridSize,
                asNavFor: '#flex-slider-H',
                after: function(slider) {
                    bLazy.revalidate();
                },
                start: function() {
                    //global.bLazy.revalidate();
                }
            });

            $('#flex-slider-H').flexslider({
                animation: "slide",
                controlNav: false,
                animationLoop: false,
                slideshow: false,
                sync: "#flex-carousel-H",
                after: function(slider) {
                    if (!!slider.currentSlide) {
                        console.log(slider.currentSlide); // put code here to avoid bug.
                        bLazy.revalidate();

                    }
                    console.log(slider.currentSlide);                  

                },
                start: function() {

                }
            });
BenRacicot commented 6 years ago

@AnupamKhosla could that be what is causing the issue I am having in #1662 ? Perhaps they are one in the same?