JSFiddle - React, Tailwind, and code Playground
HTML
<div id="background">
</div>
<div id="middleground">
</div>
<div id="foreground">
</div>
CSS
div{
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
}
#background{
z-index:1;
background:url('http://placehold.it/100x100&text=Background');
}
#middleground{
z-index:2;
background:url('http://placehold.it/250x250&text=Middleground');
opacity:.5;
}
#foreground{
z-index:3;
background:url('http://placehold.it/350x350&text=Foreground');
opacity:.25;
}
JavaScript
function AnimateMe(){
$("#background").css("background-position", "-=2");
$("#middleground").css("background-position", "-=4");
$("#foreground").css("background-position", "-=8");
}
setInterval(AnimateMe, 100);