好好看可以给份不 ,42741361@qq.com
那样的话直接CSS就可以搞定了,写了个小事例,自己改改就行了
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <style> .aa{ width: 200px; height: 200px; background-color: aqua; margin-left: auto; margin-right: auto; margin-top: 20%; } #animation{ -webkit-animation:pulse 10s .2s ease both; -moz-animation:pulse 10s .2s ease both; -webkit-animation:pulse 10s .2s 1000 ease-in normal none ; } @-webkit-keyframes pulse{ 0%{-webkit-transform:scale(1)} 50%{-webkit-transform:scale(1.5)} 100%{-webkit-transform:scale(1)} } @-moz-keyframes pulse{ 0%{-moz-transform:scale(1)} 50%{-moz-transform:scale(1.5)} 100%{-moz-transform:scale(1)} } </style> </head> <body> <div id="animation" class="aa"></div> </body> </html>