※Please check using Developer tools
.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%;
}
}
$(window).on('load', function(){
$(".block").addClass("active");
});