image continuous changing div code example
Example: image continuous changing div
//source : stackoverflow.com
// change images in a div tag after interval
$(document).ready(function () {
var imageFile = ["Image.jpg", "Image1.jpg", "Image2.jpg", "Image4.jpg"];
var currentIndex = 0;
setInterval(function () {
if (currentIndex == imageFile.length) {
currentIndex = 0;
}
$(".topstrip").css('background-image', 'url("/static/img/website/banner/' + imageFile[currentIndex++] + '")');
}, 3000);
});