I am trying to run 3 different animations side by side at the same time. Currently only the first animation is operating and the other 2 are stationary.
Can anyone advise how to run all 3 at once?
Javascript
onload = function startAnimation() {
var frames = document.getElementById("animation").children;
var frameCount = frames.length;
var i = 0;
setInterval(function () {
frames[i % frameCount].style.display = "none";
frames[++i % frameCount].style.display = "block";
}, 100);
}
HTML
<script src="animate.js"></script>
<section>
<div class="row">
<div class="col-md-4" id="animation">
<img src="animations/walk/Armature_walk_00.png">
<img src="animations/walk/Armature_walk_01.png">
<img src="animations/walk/Armature_walk_02.png">
<img src="animations/walk/Armature_walk_03.png">
<img src="animations/walk/Armature_walk_04.png">
<img src="animations/walk/Armature_walk_05.png">
<img src="animations/walk/Armature_walk_06.png">
<img src="animations/walk/Armature_walk_07.png">
<img src="animations/walk/Armature_walk_08.png">
<img src="animations/walk/Armature_walk_09.png">
<img src="animations/walk/Armature_walk_10.png">
<img src="animations/walk/Armature_walk_11.png">
<img src="animations/walk/Armature_walk_12.png">
<img src="animations/walk/Armature_walk_13.png">
<img src="animations/walk/Armature_walk_14.png">
<img src="animations/walk/Armature_walk_15.png">
</div>
<div class="col-md-4" id="animation">
<img src="animations/jump/Armature_jump_0.png">
<img src="animations/jump/Armature_jump_1.png">
<img src="animations/jump/Armature_jump_2.png">
<img src="animations/jump/Armature_jump_3.png">
<img src="animations/jump/Armature_jump_4.png">
<img src="animations/jump/Armature_jump_5.png">
<img src="animations/jump/Armature_jump_6.png">
<img src="animations/jump/Armature_jump_7.png">
<img src="animations/jump/Armature_jump_8.png">
</div>
<div class="col-md-4" id="animation">
<img src="animations/melt/Melt_1.png">
<img src="animations/melt/Melt_2.png">
<img src="animations/melt/Melt_3.png">
<img src="animations/melt/Melt_4.png">
<img src="animations/melt/Melt_5.png">
<img src="animations/melt/Melt_6.png">
<img src="animations/melt/Melt_7.png">
<img src="animations/melt/Melt_8.png">
<img src="animations/melt/Melt_9.png">
<img src="animations/melt/Melt_10.png">
<img src="animations/melt/Melt_11.png">
<img src="animations/melt/Melt_12.png">
<img src="animations/melt/Melt_13.png">
<img src="animations/melt/Melt_14.png">
<img src="animations/melt/Melt_15.png">
</div>
</div>
</section>
CSS
#animation img {
display: none;
width: 50%;
height: auto;
}
#animation img:first-child {
display: block;
width: 50%;
height: auto;
}