Open nikocraft opened 7 years ago
Hi. I can't replicate the issue. It's working well for me when I 'destroy' and then re-instantiate the slider in one of my examples.
It could be a problem in your setup... Is the error thrown when you destroy the slider or when you re-instantiate it?
Hi David
when you tested it did you test in vanila js or with vuejs? I'm trying to use it with vuejs and thats where its not working. I thought by doing this I'd be able to get slider pro to pick up any changes I have made.
I tested in vanila JavaScript. Are you sure the issue is vuejs related and not something else in your setup? Please try to replicate the same functionality in plain JavaScript.
will try, but it will probably work in plain javascript since slider pro is made to work with it. but anyways if we do not solve it, I'll just build simple vue based slider in the backend and let the user pick if they want it rendered with slider pro in the frontend or some other slider like slick slider for example.
Any news on this?. Slider keeps failing after destroy it or when its parent is hidden
I can destroy slider pro but can't later reinitialize it.
Here is my code:
here is the error I get in the console: Uncaught TypeError: Cannot read property '$slide' of undefined at SliderPro._resetSlidesPosition (content_editor.js?kaCQ3Aj:194763) at HTMLDivElement. (content_editor.js?kaCQ3Aj:194662)
at HTMLDivElement.dispatch (content_editor.js?kaCQ3Aj:9748)
at HTMLDivElement.elemData.handle (content_editor.js?kaCQ3Aj:9556)
at Object.trigger (content_editor.js?kaCQ3Aj:12743)
at jQuery.fn.init.triggerHandler (content_editor.js?kaCQ3Aj:12817)
at SliderProSlide.trigger (content_editor.js?kaCQ3Aj:195616)
at content_editor.js?kaCQ3Aj:195521
at Object.checkImagesComplete (content_editor.js?kaCQ3Aj:195789)
at SliderProSlide.resizeMainImage (content_editor.js?kaCQ3Aj:195517)
_resetSlidesPosition @ content_editor.js?kaCQ3Aj:194763
any ideas what is going on? Why should I not be able to create new slider pro after I destroyed a previous instance of it?