How to reinitialize flexslider for a dynamic loading
Asked Answered
A

2

7

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 ?

Aircondition answered 29/4, 2013 at 15:46 Comment(0)
A
32

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

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

Aircondition answered 2/5, 2013 at 9:0 Comment(5)
Your answer was very useful for me !Bot
@AlxAlx I am getting the same problem, in my case slider is initializing in normal way but images are not loading.(here whole slider inner content is coming dynamically). Any idea how to get those images?Impure
flexslider + knockout.js + this answer = amazingMines
Dude, your answer saved my as*. I am very grateful for your answer. Thank You.Failure
You da best. This was exactly what I was looking forDevora
M
8

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.

Malignity answered 29/4, 2013 at 15:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.