bxslider-4
bxslider-4 copied to clipboard
[bug] Slider runs into undefined state when reloadSlider is called before initialization was finished
I am almost afraid to add an issue to this utterly big issue list. Are all open issues still valid?
The slider is trapped in an undefined state when using reloadSlider()
before initialization actually finished. Internal variable slider.initialized
is still undefined (because asynchronously waiting for images to be loaded from original loading) so destroySlider()
inside reloadSlider()
returns too early without doing it's job to unset all necessary variables. Obviously this can be quickfixed ignoring slider.initialized inside
destroySlider()
- but I didn't analyze this for sideffects yet.
for easier comprehension check out https://github.com/stevenwanderski/bxslider-4/blob/master/src/js/jquery.bxslider.js#L1533 and https://github.com/stevenwanderski/bxslider-4/blob/master/src/js/jquery.bxslider.js#L123
These lines exclude each other inside of the mentioned trap.
Short answer is no - not all issues are valid still.
I was added to this project after it sat for a long time unmaintained. I've tried to keep up, clean up, and maintain the best I can while dealing with full time work. Most issues are actually either old, general questions that aren't issues / bugs, or have been resolved just not cleaned up.
You've proven to know your stuff and use the issue system for what it's meant to do, so please continue to report.
I'm in currently stepping into an interview for a new hire but will look at this asap.
Thanks.
I actually use bxSlider quite heavily (with lot's of api and callback usage) in a present project so i ran in several issues. I'll continue working on this.
I'll keep up contributing.
Hi,
I know it's an old issue, but I'm currently running into that same problem. Big user of bxSlider for several years, it's the first time I'm facing this.
Have you found a way to avoid it ?
Hi,
I am not in the topic so much currently but rereading my issue description removing this line should do the job: https://github.com/stevenwanderski/bxslider-4/blob/master/src/js/jquery.bxslider.js#L1558
In the end I used a modified version which besides fixing this was also containing several further tweaks. It can be found here: https://github.com/ppowalowski/bxslider-4/tree/dev
Thank you, I'll try and look your version out !
I am trying to navigate to the first slide on a button click (#first), but i am getting error as "Uncaught TypeError: Cannot read property 'goToSlide' of undefined". Below is my code: $('#first').click(function () { slider = $('.bxslider').bxSlider(); alert(slider); slider.goToSlide(0); return false; });
this is my full code in which i am using bxslider: My Code.txt
I am trying to navigate to the first slide on a button click (#first), but i am getting error as "Uncaught TypeError: Cannot read property 'goToSlide' of undefined". Below is my code: $('#first').click(function () { slider = $('.bxslider').bxSlider(); alert(slider); slider.goToSlide(0); return false; });
this is my full code in which i am using bxslider: My Code.txt
slider is not defined. Add "var" before slider = $('.bxslider')....