[Drupal] How to change the order of a slideshow on every pageload?

| | 1 min read

A large number of websites on the web today have some kind of slideshow in them and they are probably using a library like jQuery to create the slide effect. When there are 10 images cycling in a slideshow, you might want to shuffle the order of the slideshow a bit. If you have a slideshow in your Drupal website and want to know how to change the order of the slideshow on every pageload then continue reading to know more.

We can use the jQuery Shuffle plugin to change the order of a slideshow. If you want to know how to useSshuffle plugin please follow the instructions given below

  • First you have to download the jQuery Shuffle plugin
  • Next add the jQuery plugin to your drupal website.
  • Inside your existing javascript file, add the following code
    $('slideshow wrapper selector').shuffle();
  • Flush all caches and check again.

If all the steps mentioned above are followed correctly then your slideshow will randomize on every page load.