{"id":238343,"date":"2023-12-26T06:01:20","date_gmt":"2023-12-25T22:01:20","guid":{"rendered":"https:\/\/www.idc.net\/help\/238343\/"},"modified":"2023-12-26T06:01:20","modified_gmt":"2023-12-25T22:01:20","slug":"css%e5%85%a5%e9%97%a8-animation%ef%bc%88%e5%8a%a8%e7%94%bb%ef%bc%89","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/238343\/","title":{"rendered":"Css\u5165\u95e8: animation\uff08\u52a8\u753b\uff09"},"content":{"rendered":"<p>  <title id=\"css%e5%85%a5%e9%97%a8-animation%ef%bc%88%e5%8a%a8%e7%94%bb%ef%bc%89-elzwxNDXlm\">Css\u5165\u95e8: animation\uff08\u52a8\u753b\uff09<\/title><\/p>\n<h1 id=\"css%e5%85%a5%e9%97%a8-animation%ef%bc%88%e5%8a%a8%e7%94%bb%ef%bc%89-elzwxNDXlm\">Css\u5165\u95e8: animation\uff08\u52a8\u753b\uff09<\/h1>\n<h2 id=\"%e4%bb%80%e4%b9%88%e6%98%afcss%e5%8a%a8%e7%94%bb%ef%bc%9f-elzwxNDXlm\">\u4ec0\u4e48\u662fCSS\u52a8\u753b\uff1f<\/h2>\n<p>CSS\u52a8\u753b\u662f\u4e00\u79cd\u901a\u8fc7CSS\u5c5e\u6027\u548c\u5173\u952e\u5e27\u6765\u521b\u5efa\u52a8\u753b\u6548\u679c\u7684\u6280\u672f\u3002\u5b83\u53ef\u4ee5\u8ba9\u7f51\u9875\u5143\u7d20\u5728\u4e00\u6bb5\u65f6\u95f4\u5185\u53d1\u751f\u53d8\u5316\uff0c\u6bd4\u5982\u79fb\u52a8\u3001\u65cb\u8f6c\u3001\u6de1\u5165\u6de1\u51fa\u7b49\u3002CSS\u52a8\u753b\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u4ee3\u7801\u5b9e\u73b0\u590d\u6742\u7684\u52a8\u753b\u6548\u679c\uff0c\u4e3a\u7f51\u9875\u589e\u6dfb\u751f\u52a8\u548c\u4ea4\u4e92\u6027\u3002<\/p>\n<h2 id=\"css%e5%8a%a8%e7%94%bb%e7%9a%84%e5%9f%ba%e6%9c%ac%e8%af%ad%e6%b3%95-elzwxNDXlm\">CSS\u52a8\u753b\u7684\u57fa\u672c\u8bed\u6cd5<\/h2>\n<p>\u8981\u521b\u5efaCSS\u52a8\u753b\uff0c\u9700\u8981\u4f7f\u7528@keyframes\u89c4\u5219\u548canimation\u5c5e\u6027\u3002<\/p>\n<pre>\n    <code>\n      @keyframes animationName {\n        0% { property: value; }\n        50% { property: value; }\n        100% { property: value; }\n      }\n\n      .element {\n        animation-name: animationName;\n        animation-duration: 3s;\n        animation-timing-function: ease;\n        animation-delay: 1s;\n        animation-iteration-count: infinite;\n        animation-direction: alternate;\n      }\n    <\/code>\n  <\/pre>\n<h2 id=\"%e5%85%b3%e9%94%ae%e5%b8%a7%ef%bc%88keyframes%ef%bc%89-elzwxNDXlm\">\u5173\u952e\u5e27\uff08Keyframes\uff09<\/h2>\n<p>\u5173\u952e\u5e27\u662fCSS\u52a8\u753b\u4e2d\u5b9a\u4e49\u52a8\u753b\u6548\u679c\u7684\u5173\u952e\u70b9\u3002\u901a\u8fc7\u5728\u5173\u952e\u5e27\u4e2d\u6307\u5b9a\u5143\u7d20\u7684\u5c5e\u6027\u503c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5143\u7d20\u5728\u4e0d\u540c\u65f6\u95f4\u70b9\u7684\u4e0d\u540c\u72b6\u6001\u3002<\/p>\n<pre>\n    <code>\n      @keyframes slideIn {\n        0% { transform: translateX(-100%); }\n        100% { transform: translateX(0); }\n      }\n    <\/code>\n  <\/pre>\n<h2 id=\"%e5%8a%a8%e7%94%bb%e5%b1%9e%e6%80%a7%ef%bc%88animation-properties%ef%bc%89-elzwxNDXlm\">\u52a8\u753b\u5c5e\u6027\uff08Animation Properties\uff09<\/h2>\n<p>animation\u5c5e\u6027\u7528\u4e8e\u5b9a\u4e49\u52a8\u753b\u7684\u5404\u79cd\u5c5e\u6027\uff0c\u5305\u62ec\u52a8\u753b\u540d\u79f0\u3001\u6301\u7eed\u65f6\u95f4\u3001\u52a8\u753b\u901f\u5ea6\u66f2\u7ebf\u3001\u5ef6\u8fdf\u65f6\u95f4\u3001\u91cd\u590d\u6b21\u6570\u548c\u65b9\u5411\u3002<\/p>\n<pre>\n    <code>\n      .element {\n        animation-name: slideIn;\n        animation-duration: 2s;\n        animation-timing-function: ease;\n        animation-delay: 1s;\n        animation-iteration-count: infinite;\n        animation-direction: alternate;\n      }\n    <\/code>\n  <\/pre>\n<h2 id=\"%e5%b8%b8%e8%a7%81%e7%9a%84css%e5%8a%a8%e7%94%bb%e6%95%88%e6%9e%9c-elzwxNDXlm\">\u5e38\u89c1\u7684CSS\u52a8\u753b\u6548\u679c<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684CSS\u52a8\u753b\u6548\u679c\u7684\u793a\u4f8b\uff1a<\/p>\n<ul>\n<li>\u6de1\u5165\u6de1\u51fa\u6548\u679c\uff1a\u4f7f\u7528opacity\u5c5e\u6027\u5b9e\u73b0\u5143\u7d20\u7684\u900f\u660e\u5ea6\u53d8\u5316\u3002<\/li>\n<li>\u65cb\u8f6c\u6548\u679c\uff1a\u4f7f\u7528transform\u5c5e\u6027\u7684rotate\u51fd\u6570\u5b9e\u73b0\u5143\u7d20\u7684\u65cb\u8f6c\u3002<\/li>\n<li>\u7f29\u653e\u6548\u679c\uff1a\u4f7f\u7528transform\u5c5e\u6027\u7684scale\u51fd\u6570\u5b9e\u73b0\u5143\u7d20\u7684\u7f29\u653e\u3002<\/li>\n<li>\u79fb\u52a8\u6548\u679c\uff1a\u4f7f\u7528transform\u5c5e\u6027\u7684translate\u51fd\u6570\u5b9e\u73b0\u5143\u7d20\u7684\u5e73\u79fb\u3002<\/li>\n<li>\u95ea\u70c1\u6548\u679c\uff1a\u4f7f\u7528@keyframes\u89c4\u5219\u548copacity\u5c5e\u6027\u5b9e\u73b0\u5143\u7d20\u7684\u95ea\u70c1\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%bb%93%e8%ae%ba-elzwxNDXlm\">\u7ed3\u8bba<\/h2>\n<p>CSS\u52a8\u753b\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6280\u672f\uff0c\u53ef\u4ee5\u4e3a\u7f51\u9875\u589e\u6dfb\u751f\u52a8\u548c\u4ea4\u4e92\u6027\u3002\u901a\u8fc7\u4f7f\u7528@keyframes\u89c4\u5219\u548canimation\u5c5e\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u521b\u5efa\u5404\u79cd\u5404\u6837\u7684\u52a8\u753b\u6548\u679c\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u6de1\u5165\u6de1\u51fa\u8fd8\u662f\u590d\u6742\u7684\u65cb\u8f6c\u548c\u7f29\u653e\uff0cCSS\u52a8\u753b\u90fd\u53ef\u4ee5\u8ba9\u7f51\u9875\u66f4\u52a0\u5438\u5f15\u4eba\u3002<\/p>\n<h2 id=\"%e9%a6%99%e6%b8%af%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%a6%96%e9%80%89%e5%90%8e%e6%b5%aa%e4%ba%91-elzwxNDXlm\">\u9999\u6e2f\u670d\u52a1\u5668\u9996\u9009\u540e\u6d6a\u4e91<\/h2>\n<p>\u540e\u6d6a\u4e91\u662f\u4e00\u5bb6\u4e13\u4e1a\u7684\u4e91\u8ba1\u7b97\u516c\u53f8\uff0c\u63d0\u4f9b\u9ad8\u8d28\u91cf\u7684\u9999\u6e2f\u670d\u52a1\u5668\u3002\u65e0\u8bba\u60a8\u662f\u4e2a\u4eba\u7528\u6237\u8fd8\u662f\u4f01\u4e1a\u7528\u6237\uff0c\u540e\u6d6a\u4e91\u90fd\u53ef\u4ee5\u4e3a\u60a8\u63d0\u4f9b\u7a33\u5b9a\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\u89e3\u51b3\u65b9\u6848\u3002\u8bf7\u8bbf\u95ee\u6211\u4eec\u7684\u5b98\u7f51\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff1a<a href=\"https:\/\/idc.net\">https:\/\/idc.net<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Css\u5165\u95e8: animation\uff08\u52a8\u753b\uff09 Css\u5165\u95e8: animation\uff08\u52a8\u753b\uff09 \u4ec0\u4e48\u662fCSS\u52a8\u753b\uff1f CSS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197854],"tags":[],"class_list":["post-238343","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/238343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=238343"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/238343\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=238343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=238343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=238343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}