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:
ELEMENTOR PRO:
SLIDER REVOLUTION 5 –
VISUAL COMPOSER:
IMPREZA THEME:
SUBSCRIBE
LETS CONNECT:
https://twitter.com/WPTutz