<body onload="straight()">
#straight1{
width: 41.5%;
height: 0.5vh;
background-color: black;
position: absolute;
left:2%;
top:43vh;
animation:snake;
animation-duration:1s;
}
@keyframes snake{
from{width:0vh;}
to{width:41.5%;}
}
function straight(){
var x =document.getElementById('straight1');
x.style.animation="snake 3s forwards";
}
setTimeout(straight(), 3000);
Dlaczego się nie wykonuje ? Chcę by po 3 sekundach po załadowaniu się treści strony, pojawiła się ta animacja zakodowana niepoprawnie (ale gdzie ?)