So, i am trying to do an animation on my image in html/css. The problem is, it triggers when i load the page, but i want it to trigger when i scroll down to the image.
Here is my HTML part:
<figure>
<img src="Assets/Images/klenet.jpg" id="clenet_picture">
<figcaption id="clenet_text">Clenet Series 1 от 1979 година.</figcaption>
</figure>
Here is the CSS part:
#clenet_picture
{
. . .
animation-name: image-anim;
animation-duration: 4s;
}
@keyframes image-anim
{
from {opacity: 0%}
to {opacity: 100%}
}
I know i need to use some JS to make it work, but how exactly do i do that?