{"id":11841,"date":"2025-09-15T20:12:36","date_gmt":"2025-09-15T12:12:36","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=11841"},"modified":"2025-09-15T20:12:36","modified_gmt":"2025-09-15T12:12:36","slug":"css-animation-liner-function","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2025\/09\/css-animation-liner-function\/","title":{"rendered":"\u4f7f\u7528CSS linear()\u51fd\u6570\u5b9e\u73b0\u66f4\u903c\u771f\u7684\u7269\u7406\u52a8\u753b\u6548\u679c"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=11841\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=11841<\/a><br \/>\n\u672c\u6587\u53ef\u5168\u6587\u8f6c\u8f7d\uff0c\u4f46\u9700\u8981\u4fdd\u7559\u539f\u4f5c\u8005\u3001\u51fa\u5904\u4ee5\u53ca\u6587\u4e2d\u94fe\u63a5\uff0cAI\u6293\u53d6\u4fdd\u7559\u539f\u6587\u5730\u5740\uff0c\u4efb\u4f55\u7f51\u7ad9\u5747\u53ef\u6458\u8981\u805a\u5408\uff0c\u5546\u7528\u8bf7\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<h3>\u4e00\u3001\u88ab\u4f4e\u4f30\u7684linear()\u51fd\u6570<\/h3>\n<p>CSS\u52a8\u753b\u66f2\u7ebf\u51fd\u6570\u65b0\u589e\u4e86\u4e00\u4e2a\u540d\u4e3a<code>linear()<\/code>\u7684\u51fd\u6570\uff0c\u76ee\u524d\u6240\u6709\u73b0\u4ee3\u6d4f\u89c8\u5668\u90fd\u5df2\u7ecf\u652f\u6301\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-9_113451.png\" width=\"643\" height=\"321\" alt=\"linear()\u51fd\u6570\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u4e00\u5f00\u59cb\uff0c\u6211\u4ee5\u4e3a\u53c8\u662f\u4ec0\u4e48\u7f1d\u7f1d\u8865\u8865\u7684\u65b0\u7279\u6027\uff0c\u7ec6\u7ec6\u4e00\u773c\u5c31\uff0c\u53d1\u73b0\u8fd9\u4e1c\u897f\u8fd8\u662f\u633a\u5f3a\u7684\u3002<\/p>\n<p>\u4e4b\u524d\u7684\u52a8\u753b\u7f13\u52a8\u51fd\u6570\u6211\u4eec\u90fd\u662f\u4f7f\u7528<code>cubic-bezier()<\/code>\u51fd\u6570\uff0c\u8d1d\u585e\u5c14\u66f2\u7ebf\u5b9e\u73b0\u7684\uff0c\u4f46\u662f\u8fd9\u4e2a\u51fd\u6570\u6709\u4e2a\u95ee\u9898\uff0c\u6700\u591a\u5c314\u4e2a\u5c5e\u6027\u503c\uff0c\u53ea\u80fd\u5b9e\u73b0\u5148\u5feb\u540e\u6162\uff0c\u5148\u6162\u540e\u5feb\uff0c\u6216\u8005\u4e00\u6b21\u6027bounce\u7f13\u52a8\u3002<\/p>\n<p>\u4f46\u662f\u771f\u5b9e\u7684\u7269\u7406\u52a8\u753b\u5f80\u5f80\u662f\u590d\u6742\u7684\uff0c\u4f8b\u5982\u4e00\u4e2a\u76ae\u7403\u843d\u5730\uff0c\u4ed6\u4e0d\u53ef\u80fd\u53ea\u5f39\u4e00\u4e0b\uff0c\u5f80\u5f80\u8981\u8e66\u5f88\u591a\u4e0b\uff0c<code>cubic-bezier()<\/code>\u51fd\u6570\u5c31\u65e0\u6cd5\u6a21\u62df\u3002<\/p>\n<p>\u5728\u8fd9\u79cd\u80cc\u666f\u4e0b\uff0c\u5c31\u8bbe\u8ba1\u4e86<code>linear()<\/code>\u51fd\u6570\uff0c\u867d\u7136\u662f\u7ebf\u6027\u51fd\u6570\uff0c\u4f46\u662f\u53c2\u6570\u662f\u65e0\u9650\u7684\uff0c\u4e8e\u662f\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u679a\u4e3e\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u6a21\u62df\u4efb\u4f55\u7684\u8fd0\u52a8\u66f2\u7ebf\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5c0f\u7403\u843d\u5730\u7684\u52a8\u753b\u6548\u679c\u3002<\/p>\n<p>\u70b9\u51fb\u4e0b\u9762\u7684\u7bee\u7403\uff0c\u53ef\u4ee5\u67e5\u770b\u5bf9\u5e94\u7684\u52a8\u753b\u6548\u679c\uff1a<\/p>\n<div class=\"ballX\" onclick=\"this.classList.toggle('active')\"><span onanimationend=\"this.parentElement.classList.remove('active')\">\ud83c\udfc0<\/span><\/div>\n<style>\n:root {\n  --bounce-easing: linear(0, 0.004, 0.016, 0.035, 0.063, 0.098, 0.141 13.6%, 0.25, 0.391, 0.563, 0.765, 1, 0.891 40.9%, 0.848, 0.813, 0.785, 0.766, 0.754, 0.75, 0.754, 0.766, 0.785, 0.813, 0.848, 0.891 68.2%, 1 72.7%, 0.973, 0.953, 0.941, 0.938, 0.941, 0.953, 0.973, 1, 0.988, 0.984, 0.988, 1);\n}\n.ballX {\n  height: 200px;\n  border-bottom: solid;\n  display: flex;\n  justify-content: center;\n  align-items: flex-end;\n}\n.ballX span {\n  font-size: 60px;\n  line-height: 1;\n}\n.ballX.active span {\n  animation: fallDown 1s var(--bounce-easing);\n}\n@keyframes fallDown {\n  from { translate: 0 -150px; }\n  to { translate: 0 0; }\n}\n<\/style>\n<p>\u76f8\u5173\u7684HTML\u548cCSS\u4ee3\u7801\u793a\u610f\uff1a<\/p>\n<pre>&lt;div class=\"ballX\"&gt;\r\n  &lt;span&gt;\ud83c\udfc0&lt;\/span&gt;\r\n&lt;\/div&gt;<\/pre>\n<pre>:root {\r\n  --bounce-easing: linear(0, 0.004, 0.016, 0.035, 0.063, 0.098, 0.141 13.6%, 0.25, 0.391, 0.563, 0.765, 1, 0.891 40.9%, 0.848, 0.813, 0.785, 0.766, 0.754, 0.75, 0.754, 0.766, 0.785, 0.813, 0.848, 0.891 68.2%, 1 72.7%, 0.973, 0.953, 0.941, 0.938, 0.941, 0.953, 0.973, 1, 0.988, 0.984, 0.988, 1);\r\n}\r\n.ballX {\r\n  height: 200px;\r\n  border-bottom: solid;\r\n}\r\n.ballX span {\r\n  animation: fallDown 1s var(--bounce-easing);\r\n}\r\n@keyframes fallDown {\r\n  from { translate: 0 -150px; }\r\n  to { translate: 0 0; }\r\n}<\/pre>\n<p>\u5982\u679c\u5e0c\u671b\u5f39\u52a8\u66f4\u52a0\u903c\u771f\uff0c\u6211\u4eec\u53ef\u4ee5\u63d0\u9ad8\u51fd\u6570\u53c2\u6570\u7684\u7cbe\u5ea6\uff08\u5207\u5206\u66f4\u7ec6\u81f4\uff09\uff0c\u5c31\u50cf\u8fd9\u6837\uff1a<\/p>\n<pre>:root {\r\n  --bounce-easing: --linear(0 0%, 0.0009 0.7117%, 0.0034 1.3049%, 0.0144 2.6097%, 0.0586 5.2195%, 0.1313 7.8292%, 0.2356 10.5575%, 0.5338 16.2515%, 1 23.1317%, 0.8675 25.86%, 0.7715 28.707%, 0.7383 30.1305%, 0.7129 31.6726%, 0.6991 33.0961%, 0.6952 33.9265%, 0.6944 34.6382%, 0.6957 35.3499%, 0.6994 36.0617%, 0.7133 37.4852%, 0.7361 38.9087%, 0.7705 40.4508%, 0.8638 43.4164%, 1 46.6192%, 0.9404 48.5172%, 0.8981 50.4152%, 0.8725 52.3132%, 0.8657 53.2622%, 0.8629 54.3298%, 0.8647 55.2788%, 0.8705 56.2278%, 0.8959 58.2444%, 0.9357 60.1423%, 1 62.3962%, 0.9487 65.1246%, 0.9362 66.4294%, 0.9326 67.1412%, 0.9312 67.8529%, 0.9321 68.5647%, 0.9352 69.2764%, 0.9482 70.6999%, 1 73.5469%, 0.9742 75.4448%, 0.9675 76.3938%, 0.9646 77.4614%, 0.9663 78.4104%, 0.973 79.4781%, 1 81.6133%, 0.986 83.0368%, 0.9824 83.7485%, 0.9811 84.4603%, 0.982 85.172%, 0.9852 85.8837%, 0.9997 87.4259%, 0.9918 88.7307%, 0.9898 89.7983%, 0.9923 90.7473%, 0.9998 91.8149%, 0.9954 92.8826%, 0.9945 93.5943%, 0.9959 94.306%, 1 95.1364%, 0.9981 95.6109%, 0.9972 96.3227%, 1 97.3903%, 0.9988 98.102%, 0.9998 98.8138%, 1 100%);\r\n}<\/pre>\n<h3>\u4e8c\u3001linear()\u51fd\u6570\u5982\u4f55\u4f7f\u7528\uff1f<\/h3>\n<p>\u5927\u5bb6\u65e0\u9700\u5173\u5fc3<code>linear()<\/code>\u7684\u8bed\u6cd5\uff0c\u56e0\u4e3a\u5b9e\u9645\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u90fd\u662f\u901a\u8fc7\u5de5\u5177\u751f\u6210\u7684\u3002<\/p>\n<p>\u8fd9\u91cc\u4ecb\u7ecd\u4e24\u4e2a\u5de5\u5177\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/linear-easing-generator.netlify.app\/?codeType=js\" rel=\"noopener\" target=\"_blank\">linear-easing-generator<\/a><\/li>\n<li><a href=\"https:\/\/blog.nordcraft.com\/approximating-reality-with-css-linear\" rel=\"noopener\" target=\"_blank\">Nordcraft css-linear<\/a>\n<p>\u8fd9\u4e2a\u5de5\u5177\u5728\u4e0a\u9762\u94fe\u63a5\u6587\u7ae0\u7684\u4e2d\u95f4\u90e8\u5206\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u52a8\u753b\u7c7b\u578b\uff0c\u53ef\u4ee5\u770b\u5230\u5bf9\u5e94\u7684\u8fd0\u52a8\u66f2\u7ebf\u3001\u6548\u679c\u9884\u89c8\u548c\u5bf9\u5e94\u7684\u4ee3\u7801\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-9_145400.png\" width=\"492\" height=\"632\" alt=\"liner()\u6548\u679c\u793a\u610f\" class=\"alignnone size-medium\" \/><\/li>\n<\/ul>\n<p>\u8fd9\u91cc\uff0c\u91cd\u70b9\u4ecb\u7ecd\u4e0b\u4e0a\u9762\u7684\u5de5\u5177\uff08\u4ed3\u5e93\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/jakearchibald\/linear-easing-generator\" rel=\"noopener\" target=\"_blank\">linear-easing-generator<\/a>\uff09\uff0c\u56e0\u4e3a\u5176\u652f\u6301\u81ea\u5b9a\u4e49\u5b9e\u73b0\u3002<\/p>\n<h4>\u7f13\u52a8\u51fd\u6570\u8f6clinear()\u4ee3\u7801<\/h4>\n<p>\u7f51\u4e0a\u6709\u5f88\u591a\u52a8\u753b\u51fd\u6570\u7684\uff0c\u4f8b\u5982\u6bd4\u8f83\u7ecf\u5178\u7684Bounce\u5f39\u52a8\u51fd\u6570\uff1a<\/p>\n<pre>1 - Math.abs(Math.cos(t * 3.5 * Math.PI) * (1 - t))<\/pre>\n<p>\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u6211\u4eec\u76f4\u63a5\u5c06<a href=\"https:\/\/github.com\/jakearchibald\/linear-easing-generator\" rel=\"noopener\" target=\"_blank\">linear-easing-generator<\/a>\u8fd9\u4e2a\u9875\u9762\u5de6\u4fa7\u7684\u51fd\u6570\u66ff\u6362\u6210\u4e0b\u56fe\u6240\u793a\u7684\u8fd9\u6837\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-15_170805.png\" width=\"616\" height=\"86\" alt=\"\u7f13\u52a8\u51fd\u6570\u793a\u610f\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u6b64\u65f6\uff0c\u6b64\u5de5\u5177\u5c31\u4f1a\u5e2e\u6211\u4e70\u751f\u6210\u5bf9\u5e94\u7684linear()\u51fd\u6570\u4ee3\u7801\uff08\u5982\u4e0b\u56fe\u6240\u793a\uff09\uff0c\u5176\u4e2d\u7684CSS\u53d8\u91cf\u540d\u79f0\u5c31\u662fself.xxxx\u540e\u9762\u7684\u5c5e\u6027\u503c\u51b3\u5b9a\u7684\uff0c\u6211\u4eec\u8fd8\u80fd\u8c03\u6574\u52a8\u753b\u7684\u7cbe\u5ea6\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-15_171030.png\" width=\"735\" height=\"286\" alt=\"\u751f\u6210\u4ee3\u7801\u793a\u610f\" class=\"alignnone size-medium\" style=\"object-fit:cover;\" \/><\/p>\n<h5 style=\"font-size:100%;\">\u66f4\u591a\u7684\u7f13\u52a8\u51fd\u6570<\/h5>\n<p>\u4e0d\u5f97\u4e0d\u63d0\u4e00\u4e0b\u6211\u7684\u8fd9\u4e2aTween.js\u9879\u76ee\uff08 <a href=\"https:\/\/github.com\/zhangxinxu\/Tween\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/zhangxinxu\/Tween<\/a> \uff09\uff0c\u76ee\u524dStar\u5df2\u7ecf\u7834\u5343\u4e86\u3002<\/p>\n<p>\u5176\u4e2d\u5c55\u793a\u4e86\u5341\u51e0\u4e2a\u7ecf\u5178\u7684\u5404\u79cd\u7f13\u52a8\u51fd\u6570\u7b97\u6cd5\uff0c\u8bbf\u95ee\u89c1<a href=\"https:\/\/github.com\/zhangxinxu\/Tween\/blob\/master\/tween.js\" rel=\"noopener\" target=\"_blank\">\u8fd9\u91cc<\/a>\u3002<\/p>\n<p>\u4e0d\u8fc7\u8fd9\u4e9b\u51fd\u6570\u90fd\u662f4\u4e2a\u53c2\u6570\uff08\u5982\u4e0b\u56fe\u6240\u793a\uff09\uff0c\u6211\u4eec\u9700\u8981\u5c06\u90e8\u5206\u53c2\u6570\u5e38\u91cf\u5316\u624d\u80fd\u4f7f\u7528\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-15_173608.png\" width=\"736\" height=\"353\" alt=\"\u4ee3\u7801\u53c2\u6570\u793a\u610f\" class=\"alignnone size-medium\" style=\"object-fit:cover;\"  \/><\/p>\n<p>\u4ee5Bounce.easeOut\u65b9\u6cd5\u4e3e\u4f8b\uff0c\u8fd9\u662f\u5176\u539f\u672c\u7684\u51fd\u6570\uff1a<\/p>\n<pre>Bounce.easeOut = function(t, b, c, d) {\r\n    if ((t \/= d) &lt; (1 \/ 2.75)) {\r\n        return c * (7.5625 * t * t) + b;\r\n    } else if (t &lt; (2 \/ 2.75)) {\r\n        return c * (7.5625 * (t -= (1.5 \/ 2.75)) * t + .75) + b;\r\n    } else if (t &lt; (2.5 \/ 2.75)) {\r\n        return c * (7.5625 * (t -= (2.25 \/ 2.75)) * t + .9375) + b;\r\n    } else {\r\n        return c * (7.5625 * (t -= (2.625 \/ 2.75)) * t + .984375) + b;\r\n    }\r\n}<\/pre>\n<p>\u6211\u4eec\u53ea\u9700\u8981\u5c06b, c, d\u53c2\u6570\u8bbe\u7f6e\u4e3a\u5e38\u91cf\u503c\u5c31\u53ef\u4ee5\u4e86\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>self.bounceEaseOut = function(t) {\r\n  const d = 1.333;\r\n  const b = 0;\r\n  const c = 1;\r\n  if ((t \/= d) < (1 \/ 2.75)) {\r\n      return c * (7.5625 * t * t) + b;\r\n  } else if (t < (2 \/ 2.75)) {\r\n      return c * (7.5625 * (t -= (1.5 \/ 2.75)) * t + .75) + b;\r\n  } else if (t < (2.5 \/ 2.75)) {\r\n      return c * (7.5625 * (t -= (2.25 \/ 2.75)) * t + .9375) + b;\r\n  } else {\r\n      return c * (7.5625 * (t -= (2.625 \/ 2.75)) * t + .984375) + b;\r\n  }\r\n}<\/pre>\n<p>\u6b64\u65f6\uff0c\u53f3\u4e0b\u89d2\u5c31\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u6240\u793a\u7684<code>linear()<\/code>\u51fd\u6570\u4ee3\u7801\u4e86\uff0c\u5b66\u5230\u4e86\u6728\u6709\uff1f<\/p>\n<pre>:root {\r\n  --bounce-ease-out-easing: linear(0, 0.004, 0.016, 0.035, 0.062, 0.098, 0.141, 0.191, 0.25 24.2%, 0.39, 0.562, 0.765, 1 48.5%, 0.943, 0.893, 0.851, 0.816, 0.788, 0.768, 0.755, 0.75, 0.753, 0.763, 0.782, 0.809, 0.844, 0.888, 0.94, 1, 0.972);\r\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-15_180225.png\" width=\"742\" height=\"567\" alt=\"\u751f\u6210\u66f2\u7ebf\u548c\u52a8\u753b\u6548\u679c\u793a\u610f\" class=\"alignnone size-medium\" \/><\/p>\n<h3>\u4e09\u3001\u4e86\u89e3\u4e0blinear()\u51fd\u6570\u7684\u539f\u7406<\/h3>\n<p><code>linear()<\/code> \u51fd\u6570\u7684\u6838\u5fc3\u5728\u4e8e\u8ba9\u52a8\u753b\u8fdb\u5ea6\u5728\u6307\u5b9a\u7684\u591a\u4e2a\u5173\u952e\u70b9\u4e4b\u95f4\u4ee5\u6052\u5b9a\u901f\u7387\u53d8\u5316\uff0c\u4f46\u4e0d\u540c\u533a\u6bb5\u53ef\u4ee5\u8bbe\u7f6e\u4e0d\u540c\u7684\u8fdb\u5ea6\u53d8\u5316\u901f\u5ea6\uff0c\u4ece\u800c\u5f62\u6210\u4e00\u79cd\u201c\u5206\u6bb5\u7ebf\u6027\u201d\u7684\u7f13\u52a8\u6548\u679c\u3002<\/p>\n<ul>\n<li><strong>\u63a5\u53d7\u53c2\u6570\uff1a<\/strong>\u5b83\u63a5\u53d7\u4e24\u4e2a\u6216\u66f4\u591a\u7684\u6570\u503c\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u4ee3\u8868\u52a8\u753b\u7684\u8fdb\u5ea6\uff08\u901a\u5e38\u4ecb\u4e8e 0 \u5230 1 \u4e4b\u95f4\uff0c0% \u8868\u793a\u52a8\u753b\u5f00\u59cb\uff0c100% \u8868\u793a\u5b8c\u6210\uff09\u3002<\/li>\n<li><strong>\u5206\u6bb5\u7ebf\u6027\uff1a<\/strong>\u6d4f\u89c8\u5668\u4f1a\u6839\u636e\u4f60\u63d0\u4f9b\u7684\u8fd9\u4e9b\u70b9\uff0c\u8ba1\u7b97\u51fa\u591a\u4e2a\u7ebf\u6027\u7684\u901f\u5ea6\u6bb5\u3002\u5728\u6bcf\u4e2a\u533a\u6bb5\u5185\uff0c\u52a8\u753b\u7684\u901f\u5ea6\u662f\u6052\u5b9a\u7684\uff0c\u4f46\u4e0d\u540c\u533a\u6bb5\u4e4b\u95f4\u901f\u5ea6\u53ef\u80fd\u4f1a\u53d1\u751f\u7a81\u53d8\uff08\u76f4\u63a5\u8f6c\u6298\uff09\u3002<\/li>\n<li><code>\u53ef\u9009\u767e\u5206\u6bd4\uff1a<\/code>\u4f60\u8fd8\u53ef\u4ee5\u4e3a\u6bcf\u4e2a\u8fdb\u5ea6\u70b9\u6307\u5b9a\u4e00\u4e2a\u65f6\u95f4\u767e\u5206\u6bd4\uff0c\u7528\u4ee5\u63a7\u5236\u8be5\u8fdb\u5ea6\u70b9\u51fa\u73b0\u5728\u52a8\u753b\u6301\u7eed\u65f6\u95f4\u7684\u54ea\u4e2a\u65f6\u523b\u3002\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u6d4f\u89c8\u5668\u4f1a\u81ea\u52a8\u5728\u65f6\u95f4\u4e0a\u5747\u5300\u5206\u5e03\u8fd9\u4e9b\u8fdb\u5ea6\u70b9\u3002<\/li>\n<\/ul>\n<h4>\u8bed\u6cd5\u548c\u53c2\u6570<\/h4>\n<p><code>linear()<\/code> \u51fd\u6570\u53ef\u4ee5\u7528\u4e8e <code>animation-timing-function<\/code> \u6216 <code>transition-timing-function<\/code> \u5c5e\u6027\u3002<\/p>\n<pre>\/* \u8bed\u6cd5 *\/\r\nanimation-timing-function: linear(&lt;\u70b9\u5217\u8868&gt;);\r\ntransition-timing-function: linear(&lt;\u70b9\u5217\u8868&gt;);\r\n<\/pre>\n<p><strong>\u53c2\u6570\u793a\u4f8b\u4e0e\u89e3\u91ca<\/strong><\/p>\n<ul>\n<li>linear(0, 1)\uff1a\u8fd9\u8868\u793a\u4ece\u5f00\u59cb (0) \u5230\u7ed3\u675f (1) \u7684\u901f\u5ea6\u662f\u6052\u5b9a\u7684\u3002\u5b83\u7684\u6548\u679c\u4e0e\u5173\u952e\u5b57 linear \u5b8c\u5168\u76f8\u540c\u3002<\/li>\n<li>linear(0, 0.9, 1)\uff1a\u8fd9\u8868\u793a\u52a8\u753b\u7684\u524d 50% \u7684\u65f6\u95f4\u64ad\u653e\u4e86\u6574\u4f53\u8fdb\u5ea6\u7684\u524d 90%\uff0c\u800c\u540e 50% \u7684\u65f6\u95f4\u4ec5\u64ad\u653e\u5269\u4e0b\u7684 10% \u7684\u52a8\u753b\u3002\u8fd9\u610f\u5473\u7740\u524d\u534a\u6bb5\u52a8\u753b\u201c\u5f88\u5feb\u201d\uff0c\u540e\u534a\u6bb5\u52a8\u753b\u201c\u5f88\u6162\u201d\u3002<\/li>\n<li>linear(0, 0.5 20%, 0.8 60%, 1)\uff1a\u8fd9\u662f\u4e00\u4e2a\u66f4\u590d\u6742\u7684\u4f8b\u5b50\uff0c\u5b83\u901a\u8fc7\u767e\u5206\u6bd4\u7cbe\u786e\u6307\u5b9a\u4e86\u8fdb\u5ea6\u70b9\u51fa\u73b0\u7684\u65f6\u95f4\uff1a\n<ul>\n<li>\u524d 20% \u7684\u65f6\u95f4\uff1a\u52a8\u753b\u4ece 0% \u8fdb\u5c55\u5230 50%\u3002<\/li>\n<li>\u4e2d\u95f4 40% \u7684\u65f6\u95f4\uff08\u4ece 20% \u5230 60%\uff09\uff1a\u52a8\u753b\u4ece 50% \u8fdb\u5c55\u5230 80%\u3002<\/li>\n<li>\u6700\u540e 40% \u7684\u65f6\u95f4\uff08\u4ece 60% \u5230 100%\uff09\uff1a\u52a8\u753b\u4ece 80% \u8fdb\u5c55\u5230 100%\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>\u4e0e\u5176\u4ed6\u7f13\u52a8\u51fd\u6570\u5bf9\u6bd4<\/h4>\n<table class=\"params_table\" style=\"border-spacing:1px;\">\n<thead>\n<tr>\n<th>\u7f13\u52a8\u51fd\u6570<\/th>\n<th>\u7279\u70b9<\/th>\n<th>\u9002\u7528\u573a\u666f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong><code>linear()<\/code><\/strong><\/td>\n<td><strong>\u5206\u6bb5\u6052\u5b9a\u901f\u5ea6<\/strong>\uff0c\u901f\u5ea6\u53d8\u5316\u76f4\u63a5\u8f6c\u6298<\/td>\n<td>\u9700\u8981<strong>\u7cbe\u786e\u63a7\u5236\u4e0d\u540c\u9636\u6bb5\u8fdb\u5ea6\u53d8\u5316\u901f\u7387<\/strong>\u7684\u52a8\u753b<\/td>\n<\/tr>\n<tr>\n<td><code>linear<\/code> (\u5173\u952e\u5b57)<\/td>\n<td>\u4ece\u5f00\u59cb\u5230\u7ed3\u675f<strong>\u5b8c\u5168\u6052\u5b9a<\/strong>\u7684\u901f\u5ea6<\/td>\n<td>\u8fdb\u5ea6\u6761\u3001\u673a\u68b0\u611f\u5f3a\u7684\u52a8\u753b<\/td>\n<\/tr>\n<tr>\n<td><code>ease<\/code> (\u9ed8\u8ba4)<\/td>\n<td>\u6162\u901f\u5f00\u59cb\uff0c\u52a0\u901f\uff0c\u7136\u540e\u6162\u901f\u7ed3\u675f<\/td>\n<td>\u5927\u591a\u6570UI\u4ea4\u4e92\uff0c\u5982\u6309\u94ae\u60ac\u505c\u3001\u83dc\u5355\u5c55\u5f00<\/td>\n<\/tr>\n<tr>\n<td><code>ease-in<\/code><\/td>\n<td>\u6162\u901f\u5f00\u59cb\uff0c\u9010\u6e10\u52a0\u901f<\/td>\n<td>\u5143\u7d20\u4ece\u9875\u9762\u4e2d\u79bb\u5f00<\/td>\n<\/tr>\n<tr>\n<td><code>ease-out<\/code><\/td>\n<td>\u5feb\u901f\u5f00\u59cb\uff0c\u9010\u6e10\u51cf\u901f<\/td>\n<td>\u5143\u7d20\u8fdb\u5165\u9875\u9762<\/td>\n<\/tr>\n<tr>\n<td><code>ease-in-out<\/code><\/td>\n<td>\u6162\u901f\u5f00\u59cb\u548c\u7ed3\u675f\uff0c\u4e2d\u95f4\u8f83\u5feb<\/td>\n<td>\u5177\u6709\u660e\u786e\u5f00\u59cb\u548c\u7ed3\u675f\u72b6\u6001\u7684\u52a8\u753b<\/td>\n<\/tr>\n<tr>\n<td><code>cubic-bezier(n,n,n,n)<\/code><\/td>\n<td>\u901a\u8fc7\u8d1d\u585e\u5c14\u66f2\u7ebf\u81ea\u5b9a\u4e49\u901f\u5ea6\u66f2\u7ebf\uff0c\u53ef\u521b\u5efa\u975e\u5e38\u4e30\u5bcc\u548c\u81ea\u7136\u7684\u52a0\u901f\u5ea6\u53d8\u5316<\/td>\n<td>\u5f53\u9884\u5b9a\u4e49\u51fd\u6570\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\uff0c\u9700\u8981\u7279\u5b9a\u52a0\u901f\u5ea6\u6a21\u578b\u65f6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u56db\u3001\u6700\u540e\u7684\u5c0f\u7ed3<\/h3>\n<p><code>linear() <\/code>\u51fd\u6570\u4e3a\u4f60\u63d0\u4f9b\u4e86\u53e6\u4e00\u79cd\u63a7\u5236\u52a8\u753b\u8282\u594f\u7684\u5de5\u5177\u3002\u5b83\u4e0d\u662f\u901a\u8fc7\u5e73\u6ed1\u7684\u52a0\u901f\u5ea6\u66f2\u7ebf\uff0c\u800c\u662f\u901a\u8fc7\u5b9a\u4e49\u591a\u4e2a\u5173\u952e\u8fdb\u5ea6\u70b9\u53ca\u5176\uff08\u53ef\u9009\u7684\uff09\u51fa\u73b0\u65f6\u95f4\uff0c\u6765\u521b\u5efa\u4e00\u79cd\u5206\u6bb5\u6052\u901f\u3001\u901f\u5ea6\u53d8\u5316\u76f4\u63a5\u8f6c\u6298\u7684\u52a8\u753b\u6548\u679c\u3002\u5f53\u4f60\u9700\u8981\u5b9e\u73b0\u4e00\u4e9b\u975e\u4f20\u7edf\u3001\u6709\u7279\u5b9a\u8282\u594f\u6216\u9636\u68af\u5f0f\u8fdb\u5ea6\u53d8\u5316\u7684\u52a8\u753b\u65f6\uff0c<code>linear()<\/code> \u4f1a\u975e\u5e38\u6709\u7528\u3002<\/p>\n<p>\u6700\u540e\uff0c\u6e14\u83b7\u5c55\u793a\u65f6\u95f4\uff0c\u5468\u516d\u9493\u7684\uff0c\u9493\u8d39120\u5143\uff0c\u4e24\u6761\u9c7c\u52a0\u8d77\u676510\u65a4\u51fa\u5934\u4e00\u70b9\uff0c\u5207\u7ebf\u4e24\u4e2a\u5927\u7684\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-15_200210.jpeg\" width=\"216\" height=\"384\" alt=\"\u6e14\u83b7\" class=\"alignnone size-medium\" \/><\/p>\n<p>\ud83d\ude09\ud83d\ude0a\ud83d\ude07<br \/>\n\ud83e\udd70\ud83d\ude0d\ud83d\ude18<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=11841\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=11841<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202509\/2025-9-15_200741.jpeg\" width=\"160\" height=\"102\" alt=\"\u5360\u4f4d\u56fe\" class=\"alignright size-medium\" loading=\"lazy\" \/><\/p>\n<p>CSS\u65b0\u652f\u6301\u7684linear()\u51fd\u6570\u53ef\u4ee5\u8ba9\u6211\u4eec\u5b9e\u73b0\u4efb\u610f\u901f\u7387\u52a8\u753b\uff0c\u6240\u4ee5\uff0c\u65e0\u8bba\u662f\u66f4\u52a0\u903c\u771f\u7684\u7269\u7406\u52a8\u753b\uff0c\u8fd8\u662f\u7279\u6b8a\u7684\u9636\u68af\u5f0f\u52a8\u753b\u90fd\u4e0d\u5728\u8bdd\u4e0b\uff0c\u8ba9CSS\u52a8\u753b\u7684\u80fd\u529b\u8fdb\u4e00\u6b65\u589e\u5f3a\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[531,1269,1523,2080,100],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/11841"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=11841"}],"version-history":[{"count":12,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/11841\/revisions"}],"predecessor-version":[{"id":11871,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/11841\/revisions\/11871"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=11841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=11841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=11841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}