Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reinitialize flexslider for a dynamic loading

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 ?

like image 948
TheLazyFox Avatar asked Apr 29 '13 15:04

TheLazyFox


2 Answers

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

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

like image 56
TheLazyFox Avatar answered Oct 04 '22 18:10

TheLazyFox


When the download is complete, and after you make the append, try using the method again.

$('.flexslider').flexslider();

That should reinitiate it and account for new content.

like image 35
Jonny Sooter Avatar answered Oct 04 '22 18:10

Jonny Sooter