woocommerce / FlexSlider

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

Issue with Startat last slide when syncing two sliders #1599

Closed rhdesign closed 2 months ago

rhdesign commented 8 years ago

I have searched everywhere for a solution to this issue and have found multiple stack overflow's talking about the problem but nobody has a working solution. The issue is when you have 2 sliders synced together (asNavFor) and you try to set the StartAt property to the last slide it breaks the navigation slider (both arrows appear but clicking them does not work).

Below is the example code and I am running flexslider 2.6.3; flexAnimate code that is commented out is a temporary solution that gets the navigation working correctly but these are being initialized on an ajax success so i don't want the "fade" animation happening when the flexAnimate triggers

$('#viewerCarousel').flexslider({ animation: "slide", controlNav: false, animationLoop: false, slideshow: false, itemWidth: 52, itemMargin: 15, move: 3, maxItems: 3, startAt: $('#SelectedViewerImg').val(), start: function(slider){ //if ($('#SelectedViewerImg').val() == ($('#viewerCarousel .slides li').length - 1)) { // slider.flexAnimate($('#SelectedViewerImg').val(), true); //} }, asNavFor: '#viewerSlider' });

$('#viewerSlider').flexslider({
    animation: "fade",
    controlNav: false,
    directionNav: false,
    animationLoop: false,
    slideshow: false,
    startAt: $('#SelectedViewerImg').val(),
    start: function (slider) {
        //if ($('#SelectedViewerImg').val() == ($('#viewerCarousel .slides li').length - 1)) {
        //    slider.flexAnimate($('#SelectedViewerImg').val(), true);
        //}
    },
    after: function (slider) { $('#SelectedViewerImg').val(slider.currentSlide) },
    fadeFirstSlide:false,
    sync: '#viewerCarousel'
});
rhdesign commented 6 years ago

This is still an issue...anyone else have this problem or know of a working solution?