AnimatedResponsiveImageGrid icon indicating copy to clipboard operation
AnimatedResponsiveImageGrid copied to clipboard

When step is 1 first image never switches

Open phocks opened this issue 8 years ago • 3 comments

Something seems to be up with the random function and it means that the first image never switches when step equals 1.

phocks avatar Apr 01 '16 04:04 phocks

This is still broken. You get "undefined" for this.length when the function is called from _getRandom.

ivarsv avatar May 16 '16 15:05 ivarsv

I'm also still having this issue.

msbtterswrth avatar May 17 '16 12:05 msbtterswrth

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; };

arnaudthuillier avatar Jan 07 '19 13:01 arnaudthuillier