1
The estate animation-delay
only happens once in the first interaction of the animation, but after that it is no longer applied in the element.
In the example below by hovering the mouse on #container
the animation is applied to
#square
, but with a delay of 1s
:
Example:
<html>
<head>
<title>Document</title>
<style>
#container {
width: 600px;
height: 400px;
border: 1px solid black;
padding: 5px;
}
#container:hover #square {
animation: anima 2s linear infinite 1s;
}
#square {
width: 100px;
height: 100px;
background: #808080;
position: relative;
}
@keyframes anima {
0% {
left: 0;
}
100% {
left: 400px;
}
}
</style>
</head>
<body>
<div id="container">
<div id="square"></div>
</div>
</body>
</html>
After that 1s
the animation is started and when it is finished, it is executed again, but in that return the animation-delay
doesn’t work anymore. I’d like each animation interaction to property animation-delay
work and not just in the first interaction.
NOTE: in which case I’d like to just use CSS.
Thanks! @hugocsl great answer, helped me a lot, you’re the guy :)
– joão batista
@John the Baptist it’s good that you got the idea there, []
– hugocsl