I am trying to write one function that will be able to fade in/out images inside multiple divs on a single HTML page. The images in the Divs would need to fade in at the same times from each div. Then fade out followed by the next image in the div. Sort of creating a mini image rotation presentation in each div.
I cannot wrap my head around this :) I can easily make this happen without a function on a page, however, I want something that I can easily repeat with as many div's on the page as I desire. Can someone please educate me :) Thanks in advance for any suggestions, I have not been able to find this online.
EXAMPLE
function imageRotationFunction(var1, var2, var3) {
//logic I need help with
}
.
imageRotationFunction(<array of ID's to fade>, <number of seconds to fade in>, <number of seconds between fades>);
HTML PAGE HAS:
<div id='fadein0'>
<img class='imageRotation' src='someimage0.png'>
<img class='imageRotation' src='someimage1.png'>
<img class='imageRotation' src='someimage2.png'>
<img class='imageRotation' src='someimage3.png'>
</div>
<div id='fadein1'>
<img class='imageRotation' src='otherimage0.png'>
<img class='imageRotation' src='otherimage1.png'>
<img class='imageRotation' src='otherimage2.png'>
<img class='imageRotation' src='otherimage3.png'>
</div>