How to randomize initial image with jquery-cycle plugin

After searching for a solution to show a random image from the sequence using jquery-cycle, I found this post with a simple (undocumented) solution.

Just add the following line to your cycle function, replacing 4 with the total number of slides:

[code lang=”js”]startingSlide: Math.floor(Math.random()*4)[/code]

2 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *