Skip to content

Instantly share code, notes, and snippets.

@srobbin
Created September 28, 2012 13:15
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srobbin/3799775 to your computer and use it in GitHub Desktop.
Save srobbin/3799775 to your computer and use it in GitHub Desktop.
Random Backstretch image
<script>
// Create an array of images that you'd like to use
var images = [
'image1.jpg'
, 'image2.jpg'
, 'image3.jpg'
];
// Get a random number between 0 and the number of images
var randomNumber = Math.floor( Math.random() * images.length );
// Use the random number to load a random image
$.backstretch(images[randomNumber]);
</script>
@srobbin
Copy link
Author

srobbin commented Nov 18, 2019

@BillyJC: I'm sorry, I don't think I'll be able to help you with this. I'd recommend posting on Stack Overflow, and see if someone there can help you out. Best of luck.

@BillyJC
Copy link

BillyJC commented Nov 18, 2019

@srobbin:

With all due respect, because so many requests have been made for these features, it would be desirable to simply post or have a new release of Backstretch with the options of having a randomizer and captions, instead of having these people continue to grapple for a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment