鼠标悬浮,图片左右摇晃
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> .public-nav{ width: 173px; height: 183px; border: 1px solid red; } .public-nav:hover{ animation: l2r 0.4s ease-out 0s; } @keyframes l2r{ 0%{transform:rotate(0);} 25%{transform:rotate(-10deg);} 50%{transform:rotate(0deg);} 75%{transform:rotate(6deg);} 100%{transform:rotate(0deg);} } img { display: inline-block; } .goods { width: 50%; text-align: center; margin: 50px auto; } .goods img { animation: myfirst 0.1s infinite; } @keyframes myfirst { 0% { transform: translate(0px, 0px); } 50% { transform: translate(0px, -20px); } 100% { transform: translate(0px, 0px); } } </style> </head> <body> <div class="public-nav now"> <div> <img src="slider-arrow.png" alt=""> </div> </div> <div> <img src="20180914224040943.jpg" /> </div> </body> </html>
联系站长 : 17620917002
站长邮箱 : 425158482@qq.com
问题咨询 : QQ 425158482
系统长期维护,放心使用
备案号:蜀ICP备19015811号-3