Closed bovas85 closed 6 years ago
It's currently not possible to destroy an instance, but you can call instance.stop()
and basicScroll will stop animating it. instance.remove()
might be a good addition. Thanks for the idea.
No probs, that'd be fantastic as at the moment whenever I move to another dynamic route it will duplicate the instance and block the animation
Added a destroy function :) Could you please make a review of the code changes? Will make it part of the next release when everything is fine.
https://github.com/electerious/basicScroll/commit/3976d72b718ee6306a6ea5479ba1c7065f9817b7
shouldn't _destroy have an argument of index?
Not required. The index is part of there instance: https://github.com/electerious/basicScroll/commit/3976d72b718ee6306a6ea5479ba1c7065f9817b7#diff-e7ec20b0ed49ebd35a3718a4a5838760R374
Ah I see :) good stuff will test it on Monday
I use Nuxt and SPA behaviour and would like to know how to restart it (or destroy - recreate) on each route change as the method will stay alive globally but won't move the element anymore as the reference changed.