问题
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"));
});
}
});
:)
来源:https://stackoverflow.com/questions/26104112/flexslider-advance-to-next-slide-via-on-click