AnimatedResponsiveImageGrid
AnimatedResponsiveImageGrid copied to clipboard
When step is 1 first image never switches
Something seems to be up with the random function and it means that the first image never switches when step equals 1.
This is still broken. You get "undefined" for this.length when the function is called from _getRandom.
I'm also still having this issue.
That's because the shuffle function is always changing the first element so the first index is never 0.
Try with this shuffle function :
Array.prototype.shuffle = function() { var j, x, i; for (i = this.length - 1; i > 0; i--) { j = Math.floor(Math.random() * (i + 1)); x = this[i]; this[i] = this[j]; this[j] = x; } return this; };