Skip to content
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

destroy callback or reload function #157

Closed
wiedikerli opened this issue Feb 15, 2018 · 5 comments
Closed

destroy callback or reload function #157

wiedikerli opened this issue Feb 15, 2018 · 5 comments

Comments

@wiedikerli
Copy link

Issue description:
I haven't found to dynamically add / remove slides.
There is also no reload().

Could you add a reload() or a callback for the destroy function, so we could reinit the slider after added / removed slides?

Tiny-slider version: 2.5.2
Browser name && version: *
OS name && version: *

@ganlanyuan
Copy link
Owner

Just add a new method rebuild(), please refer to here.
For dynamically add/remove slides, it's much more complicated. I will consider this feature later.

@wiedikerli
Copy link
Author

Thank you! Exactly what I need.
could you deploy the new version on npm?

@ganlanyuan
Copy link
Owner

v2.6.0 was published to npm

@ghost
Copy link

ghost commented Sep 11, 2019

Hi, I'm having a problem with this rebuild, as I want to rebuild as part of a Wordpress ajax call. The initial carousel code is loading before the child divs are created, creating the 'No slides found' warning.

However, as part of my ajax function that creates the children, whe I call slider.destroy().rebuilt() I get:

Uncaught TypeError: Cannot read property 'destroy' of undefined

So how can I look for the slider first, as I believe this is because I'm trying to call destroy before the carousel is actually created in the first place...

@S1SYPHOS
Copy link
Contributor

S1SYPHOS commented Dec 3, 2019

Hey there,
I would like to see a callback for the destroy method, since I want to 'tell' the console after I destroyed the slider .. just to be sure :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants