I have a background image on a container on all pages of a site, but the home page has two images and they would like these images to scroll/fade.
I have used the answer from this post here: CSS background-image slideshow and produced the following:
<script>
var images=new Array('imageurl1','imageurl2');
var nextimage=0;
doSlideshow();
function doSlideshow(){
if(nextimage>=images.length){nextimage=0;}
$('.hometopcontentarea')
.css('background','url("'+images[nextimage++]+'") no-repeat center')
.fadeIn(500,function(){
setTimeout(doSlideshow,1000);
});
}
</script>
<div class="hometopcontentarea col-xs-12 col-sm-12" style="height: 624px; margin-bottom: 20px;">
The image paths are correct when looking at the source but unfortuately nothing is happening and the images aren't loading.
What could I be doing wrong?
Thanks in advance.