-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic content #28
Comments
My PR includes basic instructions for this: #61 |
Hmm... Dynamic content can be achieved by first destroying the existing Swipe instance and then creating a new one after dynamically playing with the content of the slider. Basically, window.mySwipe1 = new Swipe(elem, options);
mySwipe1.kill();
/* dynamically add slides HERE */
window.mySwipe2 = new Swipe(elem, options});
// repeat this cycle every time slides are added, ideally erasing each Swipe instance after `kill()` I acknowledge, this creates a lot of overhead. @axelson In your PR, you're making an exception for the setup behavior only for the I think extending (generalizing) this way of altering the configuration to all options is a better design approach (rather than relying on exceptions). Please feel free to share your thoughts! 😄 |
Yeah I think that makes sense, just wasn't sure how much work it would be to set all the options again. But perhaps if we extracted it to a new method, something like |
Yes, this |
Hi there,
I am trying to use the plugin in a webapp but get stuck on how to handle dynamic content... I checked the original project and there are some suggestions but nothing buit-in, do you have a best practice to load new slides dynamically in the list ?
Thank you ;)
The text was updated successfully, but these errors were encountered: