If you want to change it every 5 seconds, you need to use setInterval():
var loop = 1;
setInterval(function() {
var imgNumber = loop % 5;
$.backstretch("site.com/images/home" + imgNumber + ".jpg");
loop++;
}, 5000);
UPDATE
After reading the documentation, it seems that this functionality is already built into the plugin:
http://srobbin.com/jquery-plugins/backstretch/
Select "Use backstretch in slide show" for the code.
source
share