问题
I was wondering if it's possible to randomise the list of images galleria uses to be different each time on document.load
Any ideas?
回答1:
The easiest way to handle this would be to do it on the server with the scripting language of your choice. If you want to do something like this on the client side, you could look at this plugin here, which allows you to randomize an array of jQuery objects.
Should be as easy as:
$('.images').shuffle().galleria();
回答2:
Put the images in an array, sort the array randomly.
回答3:
Just use galleria's option
dataSort: 'random'
would do the job without accommodating other solution
来源:https://stackoverflow.com/questions/4714272/display-galleria-list-of-images-in-random-order