cycle2 icon indicating copy to clipboard operation
cycle2 copied to clipboard

Progressive loading with random order?

Open teapotandcake opened this issue 11 years ago • 5 comments

As far as I gather is isn't possible to have a random order of slides, when using progressive loading. Or is it?

Is it possible in cycle 1 maybe? (I've only tried in cycle 2)

Is this something that could even be pulled off in some future version?

teapotandcake avatar May 27 '13 14:05 teapotandcake

It would be great if progressive loading could have use the random option.

jolora avatar Nov 21 '13 21:11 jolora

Second that, progressive loading with a solution to randomly assign slides as per this Cycle 1 example would be fantastic… I am afraid I am not clever enough to take this example and apply to cycle2!

http://www.malsup.com/jquery/cycle/add3.html

Any ideas out there?

MattAppleton avatar Jan 01 '14 03:01 MattAppleton

I can confirm that random doesn’t work properly with progressive image loading. Maybe It could be useful to add it in the “Progressive” page under the “Limitations” title, and of course better if someone find a solution :—)

raphaelbastide avatar May 20 '14 20:05 raphaelbastide

This turns out to be an easy fix, if you add the opts.random check with a sort in the $(document).on( 'cycle-pre-initialize') function.

add to line 1426 if ( opts.random ) { slides.sort(function() {return Math.random() - 0.5;}); }

screen shot 2015-05-04 at 10 04 18 am

danielshields avatar May 04 '15 14:05 danielshields

This turns out to be an easy fix, if you add the opts.random check with a sort in the $(document).on( 'cycle-pre-initialize') function.

Thank you! This has been annoying me for literally years.

Krindi avatar Nov 07 '18 01:11 Krindi