Closed thousandzero closed 4 years ago
I think you will need to create the gallery with javascript, so you can attach events.
var flkty = new Flickity( '.carousel', {
on: {
ready: function() {
const galleryLength = this.getCellElements().length;
this.selectCell( Math.floor(galleryLength * Math.random()), true, true );
}
}
});
See https://flickity.metafizzy.co/api.html#selectcell for more details.
Test case: https://codepen.io/desandro/pen/azqbop