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

Can't click on added carousel items #1776

Open morrow95 opened 4 years ago

morrow95 commented 4 years ago

I am having trouble with the carousel when adding slides. Any slide I add with js has no click functionality in the carousel... I can't click on the thumbs of the carousel to 'go to' that image.

$('#slider2').flexslider({
    animation: "slide",
    controlNav: false,
    animationLoop: false,
    slideshow: false,
    itemWidth: 210,
    itemMargin: 5,
    asNavFor: '#slider'
});

$('#slider').flexslider({
    animation: "fade",
    animationLoop: false,
    animationSpeed: 400,
    controlNav: false,
    slideshow: false,
    slideshowSpeed: 5000,
    sync: "#slider2",
    start:function(slider){
        $(".slide-current-slide").text(slider.currentSlide+1);
        $(".slide-total-slides").text(" of "+slider.count);
    },
    before:function(slider){
        $(".slide-current-slide").text(slider.animatingTo+1);
    }
});

And an example of me adding a slide with js (ajax) :

//add the slide
slider.addSlide(''+
    '<li class="slides-content" data-id="'+value.screenshot_id+'">'+
        '<img src="/showimage.php?show='+value.image_filename+'" title="'+value.window_title+'" alt="">'+
    '</li>');                   

//add the slide
slider2.addSlide(''+
    '<li data-id="'+value.screenshot_id+'">'+
        '<img src="/showimage.php?show='+value.image_filename+'" title="'+value.window_title+'" alt="">'+
    '</li>');

//correct the count
$(".slide-total-slides").text(" of "+slider.count);

Everything works as it should except you can't click on any of the carousel images except the first one that is loaded with the page... any that are added with js have no click functionality.

Any ideas?

mavinothkumar commented 4 years ago

I too facing the same issue. Any solution ?

seanmortimer commented 3 years ago

I've found this happens when the animation is not set the same for the slider and carousel. No idea why though.