Reload Flexslider
I am using the flexslider plugin which is triggered by the following code: $(window).on('load', function () { $('.flexslider').flexslider(); }); This runs once the page has
Solution 1:
Figured out a fix:
Added the line:
$('#flexslider').removeData("flexslider");
before this one: $('.flexslider').flexslider();
Runs like a dream
Solution 2:
You can revmove the older flexslide and reinit it.
output = "";
for (num=1; num<=3; num++) {
imagesource = "Week" + num + "/Antony.png";
output = output + "<li> <img src=" + imagesource + " /> </li>";
}
var images = $("#images").append(output);
console.log(output);
$(".flexslider").remove();
$(".Your-flexslider-container").append("<div class='flexslider'></div>");
$(".flexslider").html(images);
$('.flexslider').flexslider();
Is it an example because i dont now how is your html flexslider .Try to make this code work for you.
Post a Comment for "Reload Flexslider"