Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/7470dd37f9ede32cfcd4b6ce9e5d2ac9 to your computer and use it in GitHub Desktop.
Save braddalton/7470dd37f9ede32cfcd4b6ce9e5d2ac9 to your computer and use it in GitHub Desktop.
var position = 0,
images = [
'image1.jpg',
'image2.jpg',
'image3.jpg'
];
$.backstretch(images[position]);
setInterval(function() {
if(position++ > images.length) position = 0;
$("#backstretch img").attr("src", images[position]);
$(window).trigger("resize");
}, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment