<!DOCTYPE html> <html lang="zh"> <head> <title>【css3炫酷效果 二】有弹性的蹦跳动画</title> <style> body{ margin:0; padding:0; } .jump{ width:80px; height:70px; background:#000; margin:30px auto; -webkit-animation:cute-btn 1.6s infinite; animation:cute-btn 1.6s infinite; } @-webkit-keyframes cute-btn {from {-webkit-transform:scale3d(1, 1, 1) translateY(0);transform:scale3d(1, 1, 1) translateY(0); } 5% {-webkit-transform:scale3d(1.03, 0.97, 1) translateY(-1px);transform:scale3d(1.03, 0.97, 1) translateY(-1px); } 12.5% {-webkit-transform:scale3d(1, 1, 1) translateY(-10px);transform:scale3d(1, 1, 1) translateY(-10px); } 20% {-webkit-transform:scale3d(0.98, 1.02, 1) translateY(-1px);transform:scale3d(0.98, 1.02, 1) translateY(-1px); } 25% {-webkit-transform:scale3d(1.06, 0.94, 1) translateY(0);transform:scale3d(1.06, 0.94, 1) translateY(0); } 32.5% {-webkit-transform:scale3d(0.97, 1.03, 1) translateY(-4px);transform:scale3d(0.97, 1.03, 1) translateY(-4px); } 40% {-webkit-transform:scale3d(1, 1, 1) translateY(0);transform:scale3d(1, 1, 1) translateY(0); } 100% {-webkit-transform:scale3d(1, 1, 1) translateY(0);transform:scale3d(1, 1, 1) translateY(0); } } @keyframes cute-btn {from {-webkit-transform:scale3d(1, 1, 1) translateY(0);transform:scale3d(1, 1, 1) translateY(0); } 5% {-webkit-transform:scale3d(1.03, 0.97, 1) translateY(-1px);transform:scale3d(1.03, 0.97, 1) translateY(-1px); } 12.5% {-webkit-transform:scale3d(1, 1, 1) translateY(-10px);transform:scale3d(1, 1, 1) translateY(-10px); } 20% {-webkit-transform:scale3d(0.98, 1.02, 1) translateY(-1px);transform:scale3d(0.98, 1.02, 1) translateY(-1px); } 25% {-webkit-transform:scale3d(1.06, 0.94, 1) translateY(0);transform:scale3d(1.06, 0.94, 1) translateY(0); } 32.5% {-webkit-transform:scale3d(0.97, 1.03, 1) translateY(-4px);transform:scale3d(0.97, 1.03, 1) translateY(-4px); } 40% {-webkit-transform:scale3d(1, 1, 1) translateY(0);transform:scale3d(1, 1, 1) translateY(0); } 100% {-webkit-transform:scale3d(1, 1, 1) translateY(0);transform:scale3d(1, 1, 1) translateY(0); } } </style> <head> <body> <div class="jump"><div> </body> </html>
|