// Change Image
function changeImg(){
document.getElementById(“splashImg”).src = splashImageList[i];
// Check If Index Is Under Max
if(i < splashImageList.length - 1){
// Add 1 to Index
i++;
} else {
// Reset Back To O
i = 0;
}
// Run function every x seconds
setTimeout("changeImg()", time);
}
// Run function when page loads
window.onload=changeImg;
Thanks for the reply!!
I tried your code…but Webflow seems to not allow you to set the image src. It gets it, but won’t set it. I know the code is right, but it just doesn’t work in Webflow.
Hey Scott, not sure what you’re talking about.
Of course you can update an image src with script, and it’s super easy.
Client-side script has nothing to do with Webflow, anyway, Your scripts execute in the browser after Webflow has delivered the page. It’s not involved.
Share your read-only project link and a link to your published site ( webflow.io is fine ), and we’ll have a look.
The image src and alt were, in fact, being changed, but the image was set to “responsive” in Webflow and thus the image source set was included and NOT being changed. By unchecking the “responsive” option in Webflow, the image is then determined by the src, not the srcset.
Thanks so much to everyone for the help! You are awesome!