Flexslider - advance to next slide via on click

2019-06-10 23:06发布

问题:

hoping someone can help me with a Flexslider question.

Here's a link to the slider:

http://www.findspace.co.uk/FINDSPACE2014/pages/3bed_biddrdb.html

I would really like to add an onlick function so that users can click on the current main large image and advance to the next slide. I don't mind if the directional arrows need to come off to achieve this. I guess it would need to also go back to the initial slide at the end of the sequence.

Any help would be really appreciated.

Antony

回答1:

This is how you do it

$('.flexslider').flexslider({
directionNav : false,
slideshow: false,
animation: "slide",
controlsContainer: ".flex-container",
start: function(slider) {
$('.slides li img').click(function(event){
    event.preventDefault();
    slider.flexAnimate(slider.getTarget("next"));
});
}
});

:)