You can do this by simply adding a randomization to the JS before output. This is what I changed at the bottom of the plugin’s easy-backstretch.php.
<script type=”text/javascript”>
jQuery(document).ready(function($) {
function shuffle(a) {
var j, x, i;
for (i = a.length; i; i -= 1) {
j = Math.floor(Math.random() * i);
x = a[i – 1];
a[i – 1] = a[j];
a[j] = x;
}
return a;
}
var images = [];
<?php foreach($easy_backstretch_images as $image => $data): ?>
images.push(‘<?php echo $data[‘file_url’]; ?>’);
<?php endforeach; ?>
var index = 0;
var backstretchSettings = { fade: <?php echo $easy_backstretch_settings[‘fade’]; ?>, duration:<?php echo $easy_backstretch_settings[‘duration’];?>};
var len = images.length;
var totalDuration = (backstretchSettings.fade + backstretchSettings.duration);
var timer = null;
// Randomizer order before display
shuffle(images);
var rotate = function() {
$(‘<?php echo $easy_backstretch_settings[“div”]; ?>’).backstretch(images[0], backstretchSettings);
timer = setInterval(function() {
index++;
if(index == len) {
index = 0;
}
$(‘<?php echo $easy_backstretch_settings[“div”]; ?>’).backstretch(images[index], backstretchSettings);
}, totalDuration);
};
rotate();
});
</script>