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 loaded. Later in the application I've replaced the contents of the flexslider (the number of images in it and their sources) and need to re-load the flexslider.
My code is as follows:
document.getElementById('contestant1').onclick = function() {
process();
}
output = "";
for (num=1; num<=3; num++) {
imagesource = "Week" + num + "/Antony.png";
output = output + "<li> <img src=" + imagesource + " /> </li>";
}
document.getElementById('images').innerHTML = output;
console.log(output);
$('.flexslider').flexslider();
Please tell me how to force the flexslider to re-load. Here is a link to the full application, however it has a few more complex elements not relevant to the problem:
http://eg-graphics.com/zwooper/EGVGV/Season2/MemoryWall.html