KevinBatdorf / liquidslider

A Responsive jQuery Content Slider
161 stars 62 forks source link

Change Content / Destroy / Reinitialize #170

Open MountainMaster opened 6 years ago

MountainMaster commented 6 years ago

Hi Kevin,

I'am currently working on a personalization projekt where I want to change the Slider Contents according to some segments. The problem is the timing. When i change the DOM Content the slider has already been initialized. You can see the implementation here: https://www.flatex.de/

Do you know any possibility to destroy and reinitialize the Slider? Or a safe way to stop the AutoSlide Timeout after(!) I replaced the DOM with the slider in it?

var api = $.data( $('.liquid-slider')[0], 'liquidSlider'); does not work any more when the DOM-Element has been replaced.

Thank you in advance Tobias

KevinBatdorf commented 6 years ago

Unfortunately, destroying/rebuilding is one feature I never got around to adding. You might be able to add a slide in and rerun all the events. You could try to just call api.build() after the code you have there, but it might double up on some things. You could also look inside the build function and just update the variables etc that are inside there.