Is it possible to start an animation like slideInLeft
with a link to the section where the animation is happening?
It is a simple slideInLeft
animation, so I thought it wouldn't be so hard, but I cant figure it out.
I've been looking for a while but I can't find the things I need.
<style>
@-webkit-keyframes slideInLeft {
from {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
visibility: visible;
}
to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
@keyframes slideInLeft {
from {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
visibility: visible;
}
to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
.slideInLeft {
-webkit-animation-name: slideInLeft;
animation-name: slideInLeft;
}
</style>
<a class="center" id="ClickHere" onClick="makeAnimation();" href="#WelcomePage"> <br> Click or Scroll Down <br> For More </a>
<div class="parallax animated " id="Animation"> </div>
<script>
function makeAnimation() {
var myAnimationOnclick = document.getElementById("animated").classList;
myAnimationOnclick.add("slideInLeft");
}
</script>