glide icon indicating copy to clipboard operation
glide copied to clipboard

Is there built in ways to add slides dynamically?

Open DimaGashko opened this issue 4 years ago • 1 comments

On page load I init slider with only few images (slides). Then I fetch other images data and want to add it to slider.

I can't just destroy and mount slider again because images can be loaded, for example, in the middle of swiping. So, a user can see some blinking, but I wan't do than invisible for users.

p.s. honestly, I don't understand why it's not easy and why I have to sweat of this simple task. I like Glide, but things like this... I think in our time it's required to support dynamically changes, isn't it?

DimaGashko avatar Jan 21 '20 01:01 DimaGashko

(Resolved ✅) Hi there...

I found an easy-to-use solution for this issue! the key to add or remove slides into your glider js is => Before adding or removing slides you must call destroy() Method then add your new-dynamic slides then you must initialize your Glider again! (worked 100% for me)

See the Screen-Shot below done

if your looking for more practical Example please see the below Rep: https://github.com/mdesignfa/add-or-remove-slides-form-Glider.js

mdesignfa avatar Jan 16 '24 13:01 mdesignfa