I have managed to get the beginning of my animation working and now I want the rest to animate with a slight delay after each div
height animation and its causing problems. I've tried using getElementsByClassName
and that hasn't worked.
I've posted my progress so far here in codepen.
- Tried using
getElementsByClassName
- Tried using the
.container
div
.
<html>
<head>
<script>
window.onload = function() {
let box = document.getElementById('box')
box.style.height = "100vh";
}
</script>
</head>
<body>
<div class="container" id="container">
<div class="box" id="box">
box1
</div>
<div class="box" id="box2">
box2
</div>
<div class="box" id="box3">
box3
</div>
<div class="box" id="box4">
box1
</div>
</div>
</body>
</html>
I want each individual element to animate down with delays set to each one.