I'm having trouble finding a simple jquery image swap. Most the examples I've found are more complex than I need, and do things I don't want.
Objective: I have 5 images I want to fade in, slide in, or etc. I would love to fade/dissolve from one image to the next, but slide would be fine too. When the page 1st loads, I want the 1st image to show for 4 seconds...then fade to the next image, 4 seconds, then the next, etc. Infinite loop.
Currently my code is a simple image swap, not very elegant:
document.getElementById("imgMain").src = "images/yurt/sleigh.png";
What's the best and simplest way to accomplish this?
Working example on jsFiddle.
Here's the code:
HTML
CSS
JavaScript