【CSS】How to implement an animation that bounces an image using @keyframes | Demo page

※Please check using Developer tools

Sponsored links

CSS

.block {
  width: 768px;
  margin: 50px auto 0;
}
.block.active {
  animation-duration: 1.5s;
  animation-fill-mode: both;
  animation-name: animation;
  transform-origin: center bottom;
}

@keyframes animation {
  100%,
  60%,
  30%,
  0% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(-30px);
  }
  40% {
    transform: translateY(-15px);
  }
}

@media screen and (max-width:640px){
  .block {
    width: 100%;
  }
}

JavaScript

$(window).on('load', function(){
  $(".block").addClass("active");
});