So I've been struggling with my Javascript skills using my books to get through it but I've finally found something that I can't seem to cobble together with just the books alone. What I'm trying to do is change the css background-image of a div with an id of belowNav every couple-few seconds below is the code I have that is returning no errors in the console but effectively not functioning(literally not doing anything) If someone with more JS skills than I could help it would be much appreciated :)
setInterval(function changeImage(){
var el = document.getElementById("belowNav");
var currentImage = 0;
var backImage = ["img2.png",
"IMG_3880.JPG",
"IMG_6629.JPG",
"IMG_6552.JPG",
"IMG_4090.JPG",
"IMG_0005.JPG",
"IMG_0041.JPG",
"IMG_6544.JPG",
"IMG_6628.JPG",
"IMG_5168.JPG",
"coffee.jpg"]
var lastImage = backImage.length+1;
for (var i = 0; i < 10; i++); {
currentImage = i;
el.style.backgroundImage = "%resource("+backImage[currentImage]+")%";
if(i == 10){
i = 0
}//end if
}//end for
}, 2000);//end Function
"%resource("? Also, do you realize that your for loop runs completely each time your changeImage is executed?;after"coffee.jpg"]