Skip to content

Instantly share code, notes, and snippets.

Created January 15, 2015 12:53
Show Gist options
  • Save anonymous/c0284f60f36fc1fb71b4 to your computer and use it in GitHub Desktop.
Save anonymous/c0284f60f36fc1fb71b4 to your computer and use it in GitHub Desktop.
<script>
var images = [
"http://philipdahl.com/crow/web1.jpg"
,"http://philipdahl.com/crow/web2.jpg"
,"http://philipdahl.com/crow/web3.jpg"
,"http://philipdahl.com/crow/web4.jpg"
,"http://philipdahl.com/crow/web5.jpg"
,"http://philipdahl.com/crow/web6.jpg"
,"http://philipdahl.com/crow/web7.jpg"
,"http://philipdahl.com/crow/web8.jpg"
,"http://philipdahl.com/crow/web9.jpg"
,"http://philipdahl.com/crow/web10.jpg"
,"http://philipdahl.com/crow/web11.jpg"
,"http://philipdahl.com/crow/web12.jpg"
,"http://philipdahl.com/crow/web13.jpg"
,"http://philipdahl.com/crow/web14.jpg"
,"http://philipdahl.com/crow/web15.jpg"
,"http://philipdahl.com/crow/web16.jpg"
,"http://philipdahl.com/crow/web18.jpg"
,"http://philipdahl.com/crow/web19.jpg"
,"http://philipdahl.com/crow/web20.jpg"
,"http://philipdahl.com/crow/web21.jpg"
,"http://philipdahl.com/crow/web22.jpg"
,"http://philipdahl.com/crow/web23.jpg"
,"http://philipdahl.com/crow/web24.jpg"
,"http://philipdahl.com/crow/web25.jpg"
,"http://philipdahl.com/crow/web26.jpg"
,"http://philipdahl.com/crow/web27.jpg"
,"http://philipdahl.com/crow/web28.jpg"
,"http://philipdahl.com/crow/web29.jpg"
,"http://philipdahl.com/crow/web30.jpg"
,"http://philipdahl.com/crow/web31.jpg"
,"http://philipdahl.com/crow/web32.jpg"
,"http://philipdahl.com/crow/web33.jpg"
,"http://philipdahl.com/crow/web34.jpg"
,"http://philipdahl.com/crow/web35.jpg"
,"http://philipdahl.com/crow/web36.jpg"
,"http://philipdahl.com/crow/web37.jpg"
,"http://philipdahl.com/crow/web38.jpg"
,"http://philipdahl.com/crow/web39.jpg"
,"http://philipdahl.com/crow/web40.jpg"
,"http://philipdahl.com/crow/web41.jpg"
,"http://philipdahl.com/crow/web42.jpg"
,"http://philipdahl.com/crow/web43.jpg"
,"http://philipdahl.com/crow/web44.jpg"
,"http://philipdahl.com/crow/web45.jpg"
,"http://philipdahl.com/crow/web46.jpg"
,"http://philipdahl.com/crow/web47.jpg"
,"http://philipdahl.com/crow/web48.jpg"
,"http://philipdahl.com/crow/web49.jpg"
,"http://philipdahl.com/crow/web51.jpg"
,"http://philipdahl.com/crow/web52.jpg"
,"http://philipdahl.com/crow/web53.jpg"
,"http://philipdahl.com/crow/web54.jpg"
,"http://philipdahl.com/crow/web55.jpg"
,"http://philipdahl.com/crow/web56.jpg"
,"http://philipdahl.com/crow/web57.jpg"
,"http://philipdahl.com/crow/web58.jpg"
,"http://philipdahl.com/crow/web59.jpg"
,"http://philipdahl.com/crow/web60.jpg"
,"http://philipdahl.com/crow/web61.jpg"
,"http://philipdahl.com/crow/web62.jpg"
,"http://philipdahl.com/crow/web63.jpg"
,"http://philipdahl.com/crow/web64.jpg"
,"http://philipdahl.com/crow/web65.jpg"
,"http://philipdahl.com/crow/web66.jpg"
,"http://philipdahl.com/crow/web67.jpg"
,"http://philipdahl.com/crow/web68.jpg"
,"http://philipdahl.com/crow/web69.jpg"
,"http://philipdahl.com/crow/web70.jpg"
,"http://philipdahl.com/crow/web71.jpg"
,"http://philipdahl.com/crow/web72.jpg"
,"http://philipdahl.com/crow/web73.jpg"
,"http://philipdahl.com/crow/web74.jpg"
,"http://philipdahl.com/crow/web75.jpg"
,"http://philipdahl.com/crow/web76.jpg"
,"http://philipdahl.com/crow/web77.jpg"
,"http://philipdahl.com/crow/web78.jpg"
,"http://philipdahl.com/crow/web79.jpg"
,"http://philipdahl.com/crow/web80.jpg"
,"http://philipdahl.com/crow/web81.jpg"
,"http://philipdahl.com/crow/web82.jpg"
,"http://philipdahl.com/crow/web83.jpg"
,"http://philipdahl.com/crow/web84.jpg"
,"http://philipdahl.com/crow/web85.jpg"
,"http://philipdahl.com/crow/web86.jpg"
,"http://philipdahl.com/crow/web87.jpg"
,"http://philipdahl.com/crow/web88.jpg"
,"http://philipdahl.com/crow/web89.jpg"
,"http://philipdahl.com/crow/web90.jpg"
,"http://philipdahl.com/crow/web91.jpg"
,"http://philipdahl.com/crow/web92.jpg"
,"http://philipdahl.com/crow/web93.jpg"
,"http://philipdahl.com/crow/web94.jpg"
,"http://philipdahl.com/crow/web95.jpg"
,"http://philipdahl.com/crow/web96.jpg"
,"http://philipdahl.com/crow/web97.jpg"
];
// Random index
var randomNumber = Math.floor( Math.random() * images.length );
// Call backstretch the first time
$.backstretch(images[randomNumber], {speed: 1000});
// Change images after that with setInterval
setInterval(function() {
index = Math.floor( Math.random() * images.length );
$.backstretch(images[index]);
}, 3000);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment