Learn how to easily randomize your slides in Slider Revolution 5 for WordPress.

In this video I show you 2 methods to create random sliders – Random First Slide and Random Slides.

Use the following script to randomize the first slide, while maintaining the original order of the remaining slides.

var slides = jQuery('.rev_slider').find('li'),
totalSlides = slides.length - 1,
randomIndex = Math.round(Math.random() * totalSlides);
slides.eq(randomIndex).insertBefore(slides.eq(0));

Use the following script to randomize the Slider’s starting point.

var slider = jQuery('.rev_slider ul'),
slides = slider.find('li'),
totalSlides = slides.length,
randomIndex = Math.round(Math.random() * totalSlides - 1),
ar = [], i;
 
slides.each(function(i) {ar[i] = this});
for(i = randomIndex; i < totalSlides; i++) slider.append(ar[i]);
for(i = 0; i < randomIndex; i++) slider.append(ar[i]);

Code used from https://www.themepunch.com/faq/randomize-first-slide-starting-point/

Free tutorials for WordPress, Slider Revolution and Visual Composer. New tutorials added every Wednesday.

Take your WordPress website and skills to the next level!

AFFILIATE DOWNLOADS
If you like what we do and would like to support us, please consider using these affiliate links when purchasing any of the plugins covered in our tutorials. Thank you for your support.

CSSHERO: http://bit.ly/2qbrRl6

ELEMENTOR PRO: http://bit.ly/2u3mzYX

SLIDER REVOLUTION 5 – http://bit.ly/2qDFU4G

VISUAL COMPOSER: http://bit.ly/2rnre70

IMPREZA THEME: http://bit.ly/2rn5yYx

SUBSCRIBE
http://bit.ly/2rX7rhu

LETS CONNECT:
https://twitter.com/WPTutz

Enjoy this article and want more?

Why not join our weekly newsletter and we’ll let you know when we add more awesome Wordpress tutorials and articles?

Close Menu

We use cookies to ensure that we give you the best experience on our website.