display galleria list of images in random order

强颜欢笑 提交于 2019-12-12 04:21:37

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!