Hello,
I've got a website that I'm trying to update and I'd like to have the testimonials automatically swap out every 10 seconds or so in a preformatted div tag. I have the code to make the testimonials switch but instead of a hard, instantaneous swap I'd like to have it fade out and fade in with the new one. Could you guys help me out? This is the code I have so far:
var fileArr = ["Testimonials/one.txt", "Testimonials/two.txt","Testimonials/three.txt"];
var fileInx = 0;
function dispTestimonial () {
document.getElementById("testimonials").innerHTML = getFile(fileArr[fileInx]);
fileInx++;
if (fileInx >= fileArr.length) fileInx = 0;
}
The code that you pasted into the post, does that go into the java file? You'll have to work with me a bit. I'm just getting my feet wet on the java side of coding...
It still starts with the same testimonial every time I load a new page. Is there a way to start the sequence with a random number so that one will be different as well?
Bookmarks