How to reinitialize flexslider for a dynamic loading

TheLazyFox picture TheLazyFox · Apr 29, 2013 · Viewed 26.4k times · Source

I got a problem with flexslider, I need to download my picture in base64 from a webservice. After the download is complete, I make an .append() to add my slide...

But sometimes, everything is added perfectly but the slider doesn't reload correctly So I get code like this : screen1

instead of code like this : screen2

How can I reinitiate my slider in this case ?

Answer

TheLazyFox picture TheLazyFox · May 2, 2013

Solution found ! Just add this line of code to remove the old slider ref if exists

$('#flexslider').removeData("flexslider");