我挖了代码,发现end参数传递了一个滑块对象,可以调用 addSlide 函数。
$(window).load(function() {
$('.flexslider').flexslider({
animation: "slide",
controlNav: false,
directionNav: true,
slideshow: false,
animationLoop: false,
end: function(slider){
//When 4 slides are done, it creates a callback function, but the slider is broken.
alert("Callback after of 4 slides");
slider.addSlide('<li><img title="Random 2." src="http://i.imgur.com/i32ru.jpg"> <p class="flex-caption">Captions and cupcakes. Winning combination.</p> </li>');
slider.addSlide('<li><img title="Random 2." src="http://i.imgur.com/6sMlb.jpg"> <p class="flex-caption">Captions and cupcakes. Winning combination.</p> </li>');
}
});
});