{"id":1268,"date":"2010-11-25T23:24:52","date_gmt":"2010-11-25T15:24:52","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1268"},"modified":"2018-01-01T21:12:35","modified_gmt":"2018-01-01T13:12:35","slug":"css3-transitions-transforms-animation-introduction","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2010\/11\/css3-transitions-transforms-animation-introduction\/","title":{"rendered":"CSS3 Transitions, Transforms\u548cAnimation\u4f7f\u7528\u7b80\u4ecb\u4e0e\u5e94\u7528\u5c55\u793a"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1268\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=1268<\/a><\/p>\n<h3>\u4e00\u3001\u524d\u8a00\u517c\u76ee\u5f55\u7d22\u5f15<\/h3>\n<p>\u300a\u5929\u9f99\u516b\u90e8\u300b\u91cc\u7684\u865a\u7af9\u5c0f\u548c\u5c1a\u4e4b\u524d\u53ef\u4ee5\u8bf4\u662f\u548c\u5c1a\u7684\u5148\u8fdb\u4eba\u7269\u4e0e\u4ee3\u8868\u6a21\u8303\uff0c\u5404\u7c7b\u6e05\u89c4\u6212\u5f8b\u8c28\u8bb0\u4e0e\u4e25\u5b88\u3002\u4f46\u662f\uff0c\u540e\u6765\u5462\uff0c\u82b1\u59d1\u5a18\u9001\u5230\u8ddf\u524d\uff0c\u4ec0\u4e48\u6212\u5f8b\u90fd\u6210\u4e86\u6d6e\u4e91\uff0c\u7981\u4e0d\u4f4f\u8bf1\u60d1\u4eab\u4e50\u53bb\u4e86\u3002\u554a\uff0c\u6211\u73b0\u5728\u4f3c\u4e4e\u6709\u7c7b\u4f3c\u7684\u611f\u89c9\uff0c\u672c\u6765\u4e0d\u6253\u7b97\u6df1\u7a76CSS3\u7684\u4e00\u4e9b\u5c5e\u6027\u7684\uff0c\u4f46\u662f\u5176\u6548\u679c\u4ee5\u53ca\u5b9e\u9645\u5e94\u7528\u4ef7\u503c\u4e4b\u8bf1\u60d1\u5b9e\u5728\u5de8\u5927\uff0c\u8fd8\u662f\u62b5\u6321\u4e0d\u4f4f\uff0c\u6298\u817e\u4e0b\u4e86\u8fd9\u7bc7\u6587\u7ae0\u3002\u52b3\u6c11\u4f24\u8d22\u7684\u5de5\u7a0b\u8d8a\u5c11\u8d8a\u597d\uff0c\u6240\u4ee5\uff0c\u8fd9\u91cc\u5e72\u8106\u628aCSS3 \u52a8\u753b\u76f8\u5173\u7684\u51e0\u4e2a\u5c5e\u6027\u51d1\u5408\u5230\u4e00\u8d77\u4e86\uff0c\u8fd9\u6837\uff0c\u81f3\u5c11\u4e00\u5e74\u534a\u8f7d\u5185\u4e0d\u4f1a\u518d\u5199\u76f8\u5173\u7684\u6587\u7ae0\u4e86\u3002<\/p>\n<p>CSS3\u52a8\u753b\u76f8\u5173\u7684\u51e0\u4e2a\u5c5e\u6027\u662f\uff1a<code>transition<\/code>, <code>transform<\/code>, <code>animation<\/code>\uff1b\u6211\u5206\u522b\u7406\u89e3\u4e3a\u8fc7\u6e21\uff0c\u53d8\u6362\uff0c\u52a8\u753b\u3002\u867d\u610f\u4e49\u76f8\u8fd1\uff0c\u4f46\u5177\u4f53\u89d2\u8272\u4e0d\u4e00\u3002\u5c31\u50cf\u662fSHE\u7ec4\u5408\uff0c\u867d\u7136\u90fd\u662f\u4e09\u4e2a\u5973\u751f\uff0c\u90fd\u5531\u540c\u4e00\u9996\u6b4c\uff0c\u4f46\u6709\u8d1f\u8d23\u9ad8\u97f3\uff0c\u548c\u64c5\u957f\u4f4e\u97f3\u7684\uff0c\u5177\u4f53\u5de5\u4f5c\u4e8e\u89d2\u8272\u8fd8\u662f\u6709\u5dee\u5f02\u7684\u3002<span class=\"s\">\/\/zxx:\u8c8c\u4f3c\u90a3\u4e2a\u8c01\u8c01\u70e7\u4f24\u4e86\uff0c\u771f\u662f\u4e0d\u5e78~~<img decoding=\"async\" src=\"http:\/\/timg.sjs.sinajs.cn\/t3\/style\/images\/common\/face\/ext\/normal\/d8\/sad.gif\" \/><\/span><\/p>\n<p><code>transition<\/code>\u6307\u8fc7\u6e21\u5566\uff0c\u5c31\u662f\u4ecea\u70b9\u90fdb\u70b9\uff0c\u5c31\u50cf\u8fc7\u6c5f\u5750\u6e21\u8f6e\uff0c\u662f\u6709\u65f6\u95f4\u7684\uff0c\u662f\u8fde\u7eed\u7684\uff0c\u4e00\u822c\u9488\u5bf9\u5e38\u89c4CSS\u5c5e\u6027\uff1b<code>transform<\/code>\u6307\u53d8\u6362\uff0c\u5c31\u90a3\u51e0\u4e2a\u56fa\u5b9a\u7684\u5c5e\u6027\uff1a\u65cb\u8f6c\u5566\uff0c\u7f29\u653e\u5566\uff0c\u504f\u79fb\u5566\u4ec0\u4e48\u7684\uff0c\u4e0e\u72ec\u7acb\u4e8e\u8fdc\u623f\u4eb2\u621a<code>transition<\/code>\u4f7f\u7528\uff0c\u4f46\u662f\uff0c\u6548\u679c\u5c31\u662f\u5f88\u5e72\u6da9\u673a\u68b0\u7684\u65cb\u8f6c\u79fb\u52a8\u3002\u8981\u662f\u914d\u5408transition\u5c5e\u6027\uff0c\u65cb\u8f6c\u554a\u4ec0\u4e48\u7684\uff0c\u5c31\u4f1a\u5f88\u5e73\u6ed1\u3002<code>animation<\/code>\u6700\u5148\u5b89\u5bb6\u4e8eSafari\u6d4f\u89c8\u5668\uff0c\u81ea\u6210\u4e00\u5bb6\uff0c\u4e0etransition\u548ctransform\u6709\u8001\u6b7b\u4e0d\u76f8\u5f80\u6765\u4e4b\u611f\uff0c\u4f46\u662f\u8981\u8bf4\u5355\u6311\u7684\u8bdd\uff0c<code>animation<\/code>\u8981\u6bd4<code>transition<\/code>\u5389\u5bb3\u4e9b\u3002<\/p>\n<p><strong>\u76ee\u5f55\u7d22\u5f15<\/strong><br \/>\n<a href=\"#two\">1. \u8bdd\u8bf4Transitions\u8fd9\u53ae<\/a><br \/>\n<a href=\"#three\">2. \u8bdd\u8bf4Transforms\u8fd9\u8d27<\/a><br \/>\n<a href=\"#four\">3. \u8bdd\u8bf4Animation\u8fd9\u7269<\/a><br \/>\n<a href=\"#five\">4. \u66f4\u5b9e\u9645\u7efc\u5408\u7684\u6548\u679c\u5c55\u793a<\/a><br \/>\n<a href=\"#six\">5. \u6d4f\u89c8\u5668\u652f\u6301\u60c5\u51b5<\/a><br \/>\n<a href=\"#seven\">6. \u53c2\u8003\u6587\u7ae0\u53ca\u5ef6\u4f38\u9605\u8bfb<\/a><br \/>\n<a href=\"#eight\">7. \u7ed3\u8bed\u8fd9\u4e1c\u897f<\/a><\/p>\n<h3 id=\"two\">\u4e8c\u3001\u8bdd\u8bf4Transitions\u8fd9\u53ae<\/h3>\n<p>CSS3 <code>transition<\/code>\u5c5e\u6027\u65e9\u5728\u53bb\u5e74\u6211\u7684\u201c<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=498\">CSS3 transition\u5b9e\u73b0\u8d85\u9177\u56fe\u7247\u5899\u52a8\u753b\u6548\u679c<\/a>\u201d\u4e00\u6587\u4e2d\u5c31\u6709\u8fc7\u4ecb\u7ecd\u3002\u5176\u4f5c\u7528\u662f\uff1a<strong>\u5e73\u6ed1\u7684\u6539\u53d8CSS\u7684\u503c<\/strong>\u3002\u65e0\u8bba\u662f\u70b9\u51fb\u4e8b\u4ef6\uff0c\u7126\u70b9\u4e8b\u4ef6\uff0c\u8fd8\u662f\u9f20\u6807<code>hover<\/code>\uff0c\u53ea\u8981\u503c\u6539\u53d8\u4e86\uff0c\u5c31\u662f\u5e73\u6ed1\u7684\uff0c\u5c31\u662f\u52a8\u753b\u3002\u4e8e\u662f\u4e4e\uff0c\u53ea\u8981\u4e00\u4e2a\u6574\u7ad9\u901a\u7528\u7684<code>class<\/code>\uff0c\u5c31\u53ef\u4ee5\u5f88\u8f7b\u677e\u7684\u6e10\u8fdb\u589e\u5f3a\u5730\u5b9e\u73b0\u52a8\u753b\u6548\u679c\uff0c\u8d85\u6709\u5b9e\u7528\u4ef7\u503c\u7684\u8bf4\u3002<\/p>\n<p><code>transiton<\/code>\u5c5e\u6027\u662f\u4e0b\u9762\u51e0\u4e2a\u5c5e\u6027\u7684\u7f29\u5199\uff1a<\/p>\n<dl>\n<dt>transition-property<\/dt>\n<dd>\u6307\u5b9a\u8fc7\u6e21\u7684\u5c5e\u6027\u503c\uff0c\u6bd4\u5982<code>transition-property:opacity<\/code>\u5c31\u662f\u53ea\u6307\u5b9a<code>opacity<\/code>\u5c5e\u6027\u53c2\u4e0e\u8fd9\u4e2a\u8fc7\u6e21\u3002<\/dd>\n<dt>transition-duration<\/dt>\n<dd>\u6307\u5b9a\u8fd9\u4e2a\u8fc7\u6e21\u7684\u6301\u7eed\u65f6\u95f4<\/dd>\n<dt>transition-delay<\/dt>\n<dd>\u5ef6\u8fdf\u8fc7\u6e21\u65f6\u95f4<\/dd>\n<dt>transition-timing-function<\/dt>\n<dd>\u6307\u5b9a\u8fc7\u6e21\u52a8\u753b\u7f13\u52a8\u7c7b\u578b\uff0c\u6709<code>ease<\/code> | <code>linear<\/code> | <code>ease-in<\/code> | <code>ease-out<\/code> | <code>ease-in-out<\/code> | <code>cubic-bezier()<\/code><\/p>\n<p>\u5176\u4e2d\uff0c<code>linear<\/code>\u7ebf\u6027\u8fc7\u5ea6\uff0c<code>ease-in<\/code>\u7531\u6162\u5230\u5feb\uff0c<code>ease-out<\/code>\u7531\u5feb\u5230\u6162\uff0c<code>ease-in-out<\/code>\u7531\u6162\u5230\u5feb\u5728\u5230\u6162\u3002<\/dd>\n<\/dl>\n<p>\u4f8b\u5982\u4e0b\u9762\u8fd9\u4e2a\u5f88\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.trans {\n    -webkit-transition-property: background-color;\n    -webkit-transition-duration: 0.3s;\n    -webkit-transition-timing-function: ease;\n}\n.trans:hover {\n    background-color: #486AAA;\n    color: #fff;\n}\n<\/pre>\n<\/div>\n<p>\u7ed3\u679c\u5728Safari\u6216\u662fChrome\u6d4f\u89c8\u5668\u4e0b\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u6548\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u80cc\u666f\u8272\u8fc7\u6e21\u6548\u679c\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-24_222745.png\" title=\"\u80cc\u666f\u8272\u8fc7\u6e21\u6548\u679c\" class=\"alignnone\" width=\"92\" height=\"40\" \/><\/p>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u4f7f\u7528\u6216\u6709webkit\u6838\u5fc3\u7684\u6d4f\u89c8\u5668\uff0c\u60a8\u53ef\u80fd\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-1.html\">webkit\u5185\u6838\u6d4f\u89c8\u5668\u4e0b\u80cc\u666f\u8272\u8fc7\u6e21demo<\/a><\/p>\n<p>\u5c31\u8ddfCSS2\u7684<code>background<\/code>\u5c5e\u6027\u4e00\u6837\uff0c\u5e73\u65f6\u6211\u4eec\u90fd\u4e0d\u4f1a\u50cf\u4e0a\u9762\u4e00\u6837\uff0c\u628a<code>transition<\/code>\u7684\u5c5e\u6027\u4e00\u4e2a\u4e00\u4e2a\u644a\u5f00\u5199\uff0c\u800c\u662f\u5408\u5e76\u3002<\/p>\n<p>\u8fd8\u662f\u4e0a\u9762\u7684\u4f8b\u5b50\uff0c\u6211\u4eec\u5c06transition\u5c5e\u6027\u5408\u5e76\uff0c\u5e76\u6269\u5c55\u51e0\u4e2a\u6d4f\u89c8\u5668\uff0c\u5982\u4e0bCSS\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.trans {\n    ...\n    -webkit-transition: background-color 0.3s ease;\n    -moz-transition: background-color 0.3s ease;\n    -o-transition: background-color 0.3s ease;\n    transition: background-color 0.3s ease;\n}\n.trans:hover {\n    background-color: #486AAA;\n    color: #fff;\n}\n<\/pre>\n<\/div>\n<p>\u5982\u4e0bHTML\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;a href=\"\/\" class=\"trans\">\u7ecf\u8fc7\u6211~~&lt;\/a><\/pre>\n<\/div>\n<p>\u7ed3\u679c\u5982\u4e0b\u622a\u56fe\uff08\u622a\u81eaOpera 10.6\u6d4f\u89c8\u5668\uff09\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"Opera\u4e0b\u80cc\u666f\u8272\u8fc7\u6e21\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-24_223644.png\" title=\"Opera\u4e0b\u80cc\u666f\u8272\u8fc7\u6e21\" class=\"alignnone\" width=\"295\" height=\"114\" \/><\/p>\n<p><code>transition<\/code>\u4e2d\u7684<code>transition-timing-function<\/code>\u5c5e\u6027\u8ba9\u4eba\u5fc3\u5b58\u82a5\u8482\uff0c\u5176\u4e00\u5806<code>ease<\/code>\u76f8\u5173\u7684\u503c\uff08<code>linear<\/code> | <code>ease-in<\/code> | <code>ease-out<\/code> | <code>ease-in-out<\/code> | <code>cubic-bezier<\/code>\uff09\uff0c\u4e0d\u592a\u5bb9\u6613\u8ba9\u4eba\u7406\u89e3\u4e0e\u8bb0\u4f4f\u3002\u5c24\u5176\u5176\u4e2dcubic-bezier\u5c31\u662f\u6307<a href=\"http:\/\/baike.baidu.com\/view\/60154.htm\" title=\"\u767e\u5ea6\u767e\u79d1 \u8d1d\u585e\u5c14\u66f2\u7ebf\">\u8d1d\u585e\u5c14\u66f2\u7ebf<\/a>\uff0c\u4e0e\u590d\u6742\u7684\u6570\u5b66\u626f\u4e0a\u7684\u5173\u7cfb\uff0c\u4e0d\u7981\u52fe\u8d77\u4e86\u9ad8\u4e2d\u65f6\u6570\u5b66\u7684\u68a6\u9b47\u3002<\/p>\n<p>\u5176\u5b9e\u5462\uff0c\u7406\u4e00\u7406\uff0c\u4e5f\u8fd8\u597d\u3002\u9996\u5148<code>cubic-bezier<\/code>\u8fd9\u4e2a\u57fa\u672c\u4e0a\u5c31\u4e0d\u7528\u9e1f\u4e86\uff0c90%+\u7684\u60c5\u51b5\u90fd\u7528\u4e0d\u5230\u8fd9\u4e2a\u4e1c\u897f\uff0c\u6240\u4ee5\uff0c\u96be\u5f97\u6e05\u95f2\uff0c\u76f4\u63a5pass\u6389\u3002<code>linear<\/code>\u5f88\u597d\u8bb0\uff0c\u7ebf\u6027\u561b\u3002\u81f3\u4e8e<code>ease-in<\/code> | <code>ease-out<\/code> | <code>ease-in-out<\/code>\uff0c\u5c31\u662f\u6307\u7f13\u52a8\u6548\u679c\u5566\uff0c\u8bf4\u767d\u4e86\u5c31\u662f\u6307\u5f00\u59cb\u65f6\u5019\u6162\u6162\u52a8\u5462\u8fd8\u662f\u7ed3\u675f\u7684\u65f6\u5019\u6162\u6162\u52a8\u3002\u90a3\u4e48<code>in<\/code>\u548c<code>out<\/code>\u90a3\u4e2a\u5148\u6162\u6162\u52a8\u5462\uff1f\u554a\uff0c\u6211\u4eec\u53ef\u4ee5\u8054\u60f3\u8bb0\u5fc6\uff0c\u5f88\u597d\u8bb0\u7684\u3002\u6211\u4eec\u90fd\u77e5\u9053OOXX\u5427\uff0c<code>ease-in<\/code>\u4e2d\u7684<code>in<\/code>\u5c31\u8868\u793a\u8fdb\u5165\uff0c\u8fdb\u5165\u7684\u65f6\u5019\u663e\u7136\u4e00\u5f00\u59cb\u90fd\u662f\u6162\u7684\uff0c\u7b49\u7784\u51c6\u5c31\u7eea\u540e\u624d\u80fd\u5feb\u901f\u51b2\u523a\u8fdb\u5165\uff0c\u4e8e\u662f<code>ease-in<\/code>\u8868\u793a\u5148\u6162\u540e\u5feb\uff1b<code>ease-out<\/code>\u5176<code>out<\/code>\u8868\u793a\u51fa\u6765\uff0c\u51fa\u6765\u80af\u5b9a\u662f\u5148\u5feb\u540e\u6162\u7684\uff0c\u56e0\u4e3a\u51fa\u6765\u65f6\u4e34\u8fd1\u6d1e\u53e3\u901f\u5ea6\u80af\u5b9a\u8981\u964d\u4e0b\u6765\uff0c\u514d\u5f97\u8dd1\u51fa\u6765\u4e71\u4e86\u8282\u594f\uff0c\u4e8e\u662f<code>ease-out<\/code>\u8868\u793a\u5148\u5feb\u540e\u6162\uff1b\u6700\u540e\uff0c\u5f88\u597d\u7406\u89e3\u7684\uff0c<code>ease-in-out<\/code>\u8868\u793a\u4e00\u8fdb\u4e00\u51fa\uff0c\u4e5f\u5c31\u662f\u5148\u6162\u540e\u5feb\u518d\u6162\u3002<\/p>\n<p>\u6709\u4e9b\u7eaf\u6d01\u7684\u4eba\u53ef\u80fd\u4e0d\u592a\u660e\u767d\u4e0a\u9762\u90aa\u6076\u7684\u6587\u5b57\u8868\u793a\u7684\u542b\u4e49\uff0c\u6ca1\u5173\u7cfb\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u56fe\u8bf4\u8bdd\uff0c\u4e0b\u9762\u622a\u81ea\u4e0d\u540c\u8fd0\u52a8\u66f2\u7ebf\u4e0b\u540c\u4e00\u65f6\u95f4\u7684\u622a\u56fe\uff0c\u4ece\u4e2d\u53ef\u4ee5\u770b\u5230\u54ea\u4e2a\u5148\u5feb\uff0c\u54ea\u4e2a\u5148\u6162\uff08\u6ce8\u610f\uff1a\u6700\u540e\u90fd\u662f\u540c\u65f6\u5230\u8fbe\uff09\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\u4e0d\u540c\u8fc7\u6e21\u503c\u6548\u679c\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-24_230441.png\" title=\"\u4e0d\u540c\u8fc7\u6e21\u503c\u6548\u679c\" class=\"alignnone\" width=\"552\" height=\"457\" \/><\/p>\n<p>\u8981\u662f\u4f60\u89c9\u5f97\u4e0a\u9762\u7684\u9759\u6001\u7684\u622a\u56fe\u8868\u610f\u4e0d\u591f\u5177\u4f53\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-3.html\">\u4e0d\u540c\u7f13\u52a8\u7c7b\u6548\u679cdemo<\/a>(Opera\/Chrome\/Safari)<\/p>\n<p>\u60a8\u53ef\u4ee5\u89c2\u5bdf\u65b9\u5757\u7684\u8fd0\u52a8\u89c4\u5f8b\uff0c\u77e5\u9053\u4e0d\u540c\u7f13\u52a8\u540d\u79f0\u7684\u6548\u679c\u662f\u5982\u4f55\u7684\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f<code>transition<\/code>\u7684\u7b80\u5355\u4ecb\u7ecd\uff0c\u8981\u67e5\u770b\u66f4\u8be6\u7ec6\u66f4\u6743\u5a01\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u53bb<a target=\"_blank\" href=\"http:\/\/www.w3.org\/TR\/css3-transitions\/\">\u5b98\u65b9\u9875\u9762\u67e5\u770b<\/a>\u3002<\/p>\n<h3 id=\"three\">\u4e09\u3001\u8bdd\u8bf4transform\u8fd9\u8d27<\/h3>\n<p><code>transform<\/code>\u6307\u53d8\u6362\uff0c\u4f7f\u7528\u8fc7photoshop\u7684\u4eba\u5e94\u8be5\u77e5\u9053\u91cc\u9762\u7684Ctrl+T\u81ea\u7531\u53d8\u6362\u3002<code>transform<\/code>\u5c31\u662f\u6307\u7684\u8fd9\u4e2a\u4e1c\u897f\uff0c\u62c9\u4f38\uff0c\u538b\u7f29\uff0c\u65cb\u8f6c\uff0c\u504f\u79fb\u3002\u89c1\u4e0b\u9762\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.trans_skew { transform: skew(35deg); }\n.trans_scale { transform:scale(1, 0.5); }\n.trans_rotate { transform:rotate(45deg); }\n.trans_translate { transform:translate(10px, 20px); }\n<\/pre>\n<\/div>\n<p>\u7ed3\u679c\u5c31\u6709\u7c7b\u4f3c\u4e0b\u9762\u7684\u4e9b\u6548\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"transform\u7684\u4e9b\u6548\u679c\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_205011.png\" title=\"transform\u7684\u4e9b\u6548\u679c\" class=\"alignnone\" width=\"506\" height=\"211\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a target=\"_blank\" class=\"a_link\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-4.html\">transform\u4e9b\u5c5e\u6027\u6548\u679cdemo<\/a><\/p>\n<p><code>transform<\/code>\u5c5e\u6027\u8981\u662f\u52a0\u4e0a<code>transition<\/code>\u7684\u8fc7\u6e21\u7279\u6027\uff0c\u90a3\u53ef\u5c31\u662f\u5982\u864e\u6dfb\u7ffc\uff0c\u6a31\u6728\u82b1\u9053\u914d\u4e0a\u6d41\u5ddd\u67ab\u554a\uff0c\u53ef\u4ee5\u4ea7\u751f\u4e0d\u5c11\u7f8e\u5999\u7684\u706b\u82b1\uff0c\u4f8b\u5982\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u5173\u952e\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.trans_effect {\n    -webkit-transition:all 2s ease-in-out;\n    -moz-transition:all 2s ease-in-out;\n    -o-transition:all 2s ease-in-out;\n    -ms-transition:all 2s ease-in-out;    \n    transition:all 2s ease-in-out;\n}\n.trans_effect:hover {\n    -webkit-transform:rotate(720deg) scale(2,2);\n    -moz-transform:rotate(720deg) scale(2,2);\n    -o-transform:rotate(720deg) scale(2,2);\n    -ms-transform:rotate(720deg) scale(2,2);\n    transform:rotate(720deg) scale(2,2);        \n}\n<\/pre>\n<\/div>\n<p>\u7ed3\u679c\u5728Chrome\u9884\u8ba1Safari\u6d4f\u89c8\u5668\u4e0b\u5c31\u6709\u4e86\u7956\u739b\u91cc\u9762\u9752\u86d9\u6302\u6389\u65f6\u7684\u7f29\u653e\u65cb\u8f6c\u6548\u679c\u4e86\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"transform\u52a8\u753b\u9ed8\u8ba4\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_210915.png\" title=\"transform\u52a8\u753b\u9ed8\u8ba4\" class=\"alignnone\" width=\"253\" height=\"174\" \/><\/p>\n<p>\u9f20\u6807\u7ecf\u8fc7\u65f6\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"transform\u52a8\u753b\u8fdb\u884c\u65f6\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_211150.png\" title=\"transform\u52a8\u753b\u8fdb\u884c\u65f6\u622a\u56fe\" class=\"alignnone\" width=\"311\" height=\"239\" \/><\/p>\n<p>\u5982\u679c\u4f60\u624b\u4e0a\u6709webkit\u6838\u5fc3\u7684\u6d4f\u89c8\u5668\uff0c\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-5.html\">\u9177\u9177\u7684\u7f29\u653e\u65cb\u8f6c\u52a8\u753bdemo<\/a><\/p>\n<p><code>transform<\/code>\u8fd8\u652f\u63013D\u53d8\u6362\uff0c\u600e\u4e00\u9177\u5b57\u4e86\u5f97\u3002\u7531\u4e8e\u67d0\u4e9b\u4e0d\u53ef\u544a\u4eba\u7684\u539f\u56e0\uff0c\u8fd9\u91cc\u5c31\u4e0d\u5c55\u793a\u4e86\u3002\u6545\uff0c<code>transform<\/code>\u90e8\u5206\u5230\u6b64\u7ed3\u675f\u3002<\/p>\n<h3 id=\"four\">\u56db\u3001\u8bdd\u8bf4animations\u8fd9\u7269<\/h3>\n<p>\u622a\u6b622010\u5e7411\u6708\u4efd\uff0c<code>animations<\/code>\u8fd9\u7269\u4f3c\u4e4e\u8fd8\u662f\u53ea\u5728webkit\u6838\u5fc3\u7684\u6d4f\u89c8\u5668\u4e0a\u8d77\u4f5c\u7528\uff0c\u6240\u4ee5\u672c\u6bb5\u843d\u7684\u4e00\u4e9bdemo\u6548\u679c\uff0c\u9700\u5728webkit\u6838\u5fc3\u6d4f\u89c8\u5668\u4e0b\u67e5\u770b\uff0c\u4e0d\u5728\u91cd\u590d\u8d58\u8ff0\u3002<\/p>\n<p><code>animations<\/code>\u7684\u4ecb\u7ecd\u4ee5\u5b9e\u4f8b\u9a71\u52a8\u3002\u5148\u770b\u7b80\u5355\u7684\u7f29\u653e\u6269\u5c55\u52a8\u753b\u5b9e\u4f8b\uff1a<br \/>\n\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-6.html\">animations\u6c34\u5e73\u5f39\u6027\u7f29\u653e\u53d8\u8272\u52a8\u753b<\/a><\/p>\n<p>\u6548\u679c\u5927\u81f4\u5982\u4e0b\uff0c\u9ed8\u8ba4\u662f\u4e2a\u5f88\u89c4\u77e9\u5f88\u5b89\u9759\u7684\u77e9\u5f62\u6846\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u5b89\u9759\u7684\u77e9\u5f62\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_213757.png\" title=\"\u5b89\u9759\u7684\u77e9\u5f62\" class=\"alignnone\" width=\"261\" height=\"199\" \/><\/p>\n<p>\u9f20\u6807\u79fb\u4e0a\u53bb\u540e\u663e\u793a\u6162\u6162\u7684\u5bbd\u5ea6\u589e\u52a0\uff0c\u7136\u540e\u7a81\u7136\u5feb\u901f\u7684\u5bbd\u5ea6\u589e\u52a0\uff0c\u540c\u65f6\u80cc\u666f\u8272\u52a0\u6df1\uff0c\u4e0b\u4e3a\u52a8\u753b\u8fc7\u7a0b\u4e2d\u7684\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"animate\u52a8\u753b\u8fc7\u7a0b\u4e2d\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_214152.png\" title=\"animate\u52a8\u753b\u8fc7\u7a0b\u4e2d\u622a\u56fe\" class=\"alignnone\" width=\"370\" height=\"202\" \/><\/p>\n<p>\u5173\u952e\u7684CSS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n@-webkit-keyframes resize {\n    0% {\n        padding: 0;\n    }\n    50% {\n        padding: 0 20px;\n        background-color:rgba(190, 206, 235, 0.2);        \n    }\n    100% {\n        padding: 0 100px;\n        background-color:rgba(190, 206, 235, 0.9);\n    }\n}\n.anim_box:hover {\n    -webkit-animation-name: resize;\n    -webkit-animation-duration: 1.5s;\n    -webkit-animation-iteration-count: 4;\n    -webkit-animation-direction: alternate;\n    -webkit-animation-timing-function: ease-in-out;\n}\n<\/pre>\n<\/div>\n<p>\u6b64\u4f8b\u5b50\u4e2d\uff0c\u9f20\u6807\u60ac\u505c\u65f6\u52a8\u753b\u53ea\u6267\u884c4\u6b21\u3002<\/p>\n<p><code>animations<\/code>\u4e0d\u4ec5\u9002\u7528\u4e8eCSS2\u4e2d\u7684\u5c5e\u6027\uff0cCSS3\u4e5f\u662f\u652f\u6301\u7684\uff0c\u4f8b\u5982<code>box-shadow<\/code>\u76d2\u9634\u5f71\u6548\u679c\uff0c\u6240\u4ee5\uff0c\u6211\u4eec\u53ef\u4ee5\u5b9e\u73b0\u5916\u53d1\u5149\u6548\u679c\u7684\u3002\u4f7f\u7528\u8fc7web qq\u7684\u4eba\u5e94\u8be5\u6709\u5370\u8c61\uff0c\u5f53\u9f20\u6807\u79fb\u5230\u804a\u5929\u5bf9\u8c61\u8111\u888b\u4e0a\u7684\u65f6\u5019\u4f1a\u6709\u84dd\u8272\u5916\u53d1\u5149\u7684\u52a8\u753b\uff0c\u4f46\u662f\u90a3\u662fgif\u52a8\u753b\u56fe\u7247\u5b9e\u73b0\u7684\uff08\u73b0\u5728\u81ea\u52a8\u8df3\u8f6c\u5230web qq 2.0\u5df2\u770b\u4e0d\u5230\u6548\u679c\uff09\u3002gif\u52a8\u753b\u5b9e\u73b0\u7684\u6548\u679c\u7c7b\u4f3c\u4e8e\u4e0b\u9762\uff08\u5f88\u517c\u5bb9\uff09\uff1a<\/p>\n<style>\n.gif_img{display:inline-block; padding:4px;}\n.gif_img:hover{background:url(http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/img_out_light.gif) no-repeat;}\n<\/style>\n<p><span class=\"gif_img\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201801\/head14.jpg\" width=\"71\" height=\"71\" \/><\/span> <span style=\"font-size:12px; color:#666;\">\u6478\u5de6\u8fb9\u59b9\u5b50<\/span><\/p>\n<p>\u4f46\u662fgif\u7684\u91cd\u7528\u6027\u6709\u9650\u800c\u4e14\u5236\u4f5c\u7834\u8d39\u529f\u592b\uff0c\u5982\u679c\u7b80\u5355\u51e0\u884cCSS\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0\u9ad8\u6027\u80fd\u9ad8\u6269\u5c55\u7684\u6548\u679c\u5c82\u4e0d\u66f4\u52a0\uff0c\u73b0\u5728<code>animations<\/code>\u5c31\u53ef\u4ee5\u641e\u5b9a\u8fd9\u4e00\u4e9b\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-7.html\">animations\u4e0b\u7684\u5916\u53d1\u5149\u52a8\u753bdemo<\/a><\/p>\n<p>\u53d1\u5149\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\u5916\u53d1\u5149\u6548\u679cdemo\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201801\/2018-01-01_211041.png\" width=\"216\" height=\"217\" \/><\/p>\n<p>\u4e3b\u8981\u7684CSS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n@-webkit-keyframes glow {\n    0% {\n        -webkit-box-shadow: 0 0 12px rgba(72, 106, 170, 0.5);\n        border-color: rgba(160, 179, 214, 0.5);         \n    }\n    100% {\n        -webkit-box-shadow: 0 0 12px rgba(72, 106, 170, 1.0), 0 0 18px rgba(0, 140, 255, 1.0);\n        border-color: rgba(160, 179, 214, 1.0); \n    }\n}\n.anim_image {\n    padding:3px;\n    border:1px solid #beceeb;\n    background-color:white;\n    -moz-box-shadow: 0 0 8px rgba(72, 106, 170, 0.5);\n    -webkit-box-shadow: 0 0 8px rgba(72, 106, 170, 0.5);\n    box-shadow: 0 0 8px rgba(72, 106, 170, 0.5);\n}\n.anim_image:hover {\n    background-color:#f0f3f9;\n    -webkit-animation-name: glow;\n    -webkit-animation-duration: 1s;\n    -webkit-animation-iteration-count: infinite;\n    -webkit-animation-direction: alternate;\n    -webkit-animation-timing-function: ease-in-out;    \n}\n<\/pre>\n<\/div>\n<p><code>animation<\/code>\u5c55\u793a\u7ed3\u675f\uff0c\u7684\u8bf4~~<\/p>\n<h3 id=\"five\">\u4e94\u3001\u66f4\u5b9e\u9645\u7efc\u5408\u7684\u6548\u679c\u5c55\u793a<\/h3>\n<p>\u9996\u5148\uff0c<strong>\u9f20\u6807\u60ac\u505c\u7684\u6de1\u5165\u6de1\u51fa<\/strong>\u6548\u679c\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-8.html\">\u9f20\u6807\u60ac\u505c\u7684\u6de1\u5165\u6de1\u51fademo<\/a><\/p>\n<p>\u76ee\u524d\uff0c\u975ewebkit\u6838\u5fc3\u6d4f\u89c8\u5668\u4e0b\u9762\uff0c\u9f20\u6807\u60ac\u505c\u4ec5\u4ec5\u662f\u900f\u660e\u4e0e\u4e0d\u900f\u660e\uff0c\u53ea\u6709\u5728webkit\u6838\u5fc3\u6d4f\u89c8\u5668\u4e0b\u9762\u624d\u6709\u5e73\u6ed1\u7684\u52a8\u753b\u6548\u679c\uff0c\u5982\u4e0b\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u6de1\u5165\u6de1\u51fa\u8fc7\u7a0b\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_221854.png\" title=\"\u6de1\u5165\u6de1\u51fa\u8fc7\u7a0b\u622a\u56fe\" class=\"alignnone\" width=\"321\" height=\"222\" \/><\/p>\n<p>\u76f8\u5173\u4e3b\u8981CSS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.anim_fade_image {\n    position:absolute;\n    -webkit-transition: opacity 1s ease-in-out;\n    -moz-transition: opacity 1s ease-in-out;\n    -o-transition: opacity 1s ease-in-out;\n    transition: opacity 1s ease-in-out;\n}\n.anim_fade_image:hover, .anim_fade_image_hover {\n    opacity:0;\n    filter: alpha(opacity=0);\n}\n<\/pre>\n<\/div>\n<p>\u5f53\u7136\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u8f85\u52a9JavaScript\uff0c\u6dfb\u52a0<strong>\u70b9\u51fb\u56fe\u7247\u6de1\u51fa\u6de1\u51fa<\/strong>\u3002JavaScript\u8d1f\u8d23\u7684\u53ea\u662f\u7ec8\u4e86\u7684\u900f\u660e\u5ea6\u503c\uff0c\u4e2d\u95f4\u7684\u52a8\u753b\u76f4\u63a5\u4ea4\u7ed9CSS\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-9.html\">\u70b9\u51fb\u4e0b\u7684\u6de1\u5165\u6de1\u51fademo<\/a><\/p>\n<p>\u6548\u679c\u7c7b\u4f3c\uff0c\u5c31\u4e0d\u5c55\u793a\u622a\u56fe\u4e86\uff0c\u4ee3\u7801\u7c7b\u4f3c\uff0c\u5c31\u4e0d\u5c55\u793a\u4ee3\u7801\u4e86\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u505a\u4e9b\u5c0f\u52a8\u753b\uff0c\u8ba9<strong>\u56fe\u7247\u81ea\u52a8\u6de1\u5165\u6de1\u51fa<\/strong>\u7684\u64ad\u653e\uff0c\u4e0d\u505c\u5730\u64ad\u653e\u3002\u8981\u4e0d\u505c\u64ad\u653e\u53ea\u8981\u5c06<code>animation-iteration-count<\/code>\u8bbe\u4e3a<code>infinite<\/code>\uff08\u65e0\u9650\uff09\u5c31ok\u7684\u5566\u3002\u4e8e\u662f\uff0c\u6211\u4eec\u4fee\u6539\u4e0bCSS\u4ee3\u7801\uff0c\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n@-webkit-keyframes fadeInOut {\n    0% {\n        opacity:1;\n     }\n    25% {\n        opacity:0;\n    }\n    50% {\n        opacity: 0;    \n    }\n    75% {\n        opacity:1;\n    }\n}\n.anim_fade_image {\n    position:absolute;    \n    -webkit-animation-name: fadeInOut;\n    -webkit-animation-timing-function: ease-in-out;\n    -webkit-animation-iteration-count: infinite;\n    -webkit-animation-duration: 12s;\n    -webkit-animation-direction: alternate;\n}\n<\/pre>\n<\/div>\n<p>\u4e8e\u662f\u4e4e\uff0c\u56fe\u7247\u5c31\u7a00\u91cc\u7cca\u6d82\u7684\u4e0d\u505c\u5730\u6de1\u5165\u6de1\u51fa\u4e86\u3002\u60a8\u6709\u5174\u8da3\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-10.html\">\u56fe\u7247\u65e0\u9650\u81ea\u52a8fade\u6548\u679cdemo<\/a><\/p>\n<p>\u4ee5\u4e0a\u4e9b\u6548\u679c\u90fd\u662f\u4e0e\u900f\u660e\u5ea6\u6253\u4ea4\u9053\u7684\u3002\u4e0b\u9762\u8fd9\u4e2a\u5b9e\u4f8b\u662f\u4e0e\u56fe\u7247\u4f4d\u7f6e\uff0c\u6bd4\u4f8b\u5c3a\u5bf8\u6302\u94a9\u7684\uff0c\u806a\u660e\u7684\u4f60\u662f\u4e0d\u662f\u60f3\u5230\u4e86<code>transform<\/code>\u5c5e\u6027\u5462\u3002\u5bf9\u7684\uff0c<code>transform<\/code>+<code>tranisition<\/code>\uff0c\u53cc\u5251\u5408\u74a7\uff0c\u5929\u4e0b\u65e0\u654c\u3002\u4e0b\u9762\u8fd9\u4e2a\u6548\u679c\u662f\u5f88\u9177\u5f88\u9177\u7684\uff0c\u4ee5\u524d\u57fa\u672c\u4e0a\u53ea\u80fd\u5728Flash\u4e2d\u53ef\u4ee5\u770b\u5230\u3002\u5f53\u5f53\u5f53\u5f53\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-11.html\">\u56fe\u7247\u8f6e\u8f6c\u7f29\u653e\u663e\u793a\u52a8\u753bdemo<\/a>\uff08\u9f20\u6807\u7ecf\u8fc7\u56fe\u7247\u6709\u60ca\u559c\u7684\u8bf4\uff0c\u975ewebkit\u7ed5\u9053\uff0c\u641c\u72d7\u7b49\u6d4f\u89c8\u5668\u53ef\u5207\u6362\u5230\u9ad8\u901f\u6a21\u5f0f\u4ea6\u53ef\uff09\u3002<\/p>\n<p>\u6548\u679c\u622a\u56fe\u5982\u4e0b\uff0c\u4e3a\u52a8\u753b\u8fc7\u7a0b\u4e2d\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\u5927\u5c0f\u8f6e\u6362\u52a8\u753b\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_224100.png\" title=\"\u56fe\u7247\u5927\u5c0f\u8f6e\u6362\u52a8\u753b\u622a\u56fe\" class=\"alignnone\" width=\"317\" height=\"219\" \/><\/p>\n<p>\u76f8\u5173\u7684\u6838\u5fc3\u7684CSS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.anim_image {\n    -webkit-transition: all 1s ease-in-out;\n    -moz-transition: all 1s ease-in-out;\n    -o-transition: all 1s ease-in-out;\n    transition: all 1s ease-in-out;\n    cursor:pointer;\n}\n.anim_image_top {\n    position: absolute;\n    -webkit-transform: scale(0, 0);\n    opacity: 0;\n    filter: Alpha(opacity=0);\n}\n.anim_box:hover .anim_image_top , .anim_box_hover .anim_image_top {\n    opacity: 1;\n    filter: Alpha(opacity=100);\n    -webkit-transform: scale(1, 1);\n    -webkit-transform-origin: top right;        \n}\n.anim_box:hover .anim_image_bottom, .anim_box_hover .anim_image_bottom {\n    -webkit-transform: scale(0, 0);\n    -webkit-transform-origin: bottom left;\n}\n<\/pre>\n<\/div>\n<p>HTML\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n&lt;div id=\"testBox\" class=\"anim_box\">\n    &lt;img class=\"anim_image anim_image_top\" src=\"ps6.jpg\" \/>\n    &lt;img class=\"anim_image anim_image_bottom\" src=\"ps4.jpg\" \/>\n&lt;\/div>\n<\/pre>\n<\/div>\n<p>\u5f53\u7136\uff0c\u8fd9\u91cc\u5e94\u7528<code>transform<\/code>\u7684\u65cb\u8f6c\uff0c\u6c34\u5e73\u5782\u76f4\u7f29\u653e\u6548\u679c\u4e5f\u662f\u5f88\u8d5e\u7684\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\u65cb\u8f6c\u5207\u6362\u52a8\u753b\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_224543.png\" title=\"\u56fe\u7247\u65cb\u8f6c\u5207\u6362\u52a8\u753b\u622a\u56fe\" class=\"alignnone\" width=\"313\" height=\"200\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-12.html\">\u56fe\u7247\u65cb\u8f6c\u5207\u6362\u52a8\u753bdemo<\/a><\/p>\n<p>CSS\u4ee3\u7801\u4e0e\u4e0a\u9762\u7684\u4f8b\u5b50\u5927\u540c\u5c0f\u5f02\uff0c\u8fd9\u91cc\u5c31\u4e0d\u5c55\u793a\u4e86\uff0c\u60a8\u53ef\u4ee5\u53bbdemo\u9875\u9762\u67e5\u770b\u3002<\/p>\n<p>\u4e0b\u9762\uff0c\u5c55\u793a\u7684\u662f\u66f4\u52a0\u5b9e\u9645\u66f4\u52a0\u9760\u8c31\u7684\u4f8b\u5b50\uff0c<strong>\u9009\u9879\u5361\u5207\u6362<\/strong>\u3002<br \/>\n\u6211\u4eec\u5e73\u65f6\u7684\u9009\u9879\u5361\u5207\u6362\u57fa\u672c\u4e0a\u90fd\u662f\u5f88\u751f\u786c\u7684\uff0c\u76f4\u63a5\u556a\u556a\u556a\uff0c\u5207\u6362\u8fc7\u6765\u4e86\uff0c\u6ca1\u6709\u70b9\u8fc7\u6e21\u554a\u4ec0\u4e48\u7684\uff08\u6bd5\u7adf\u5199JavaScript\u52a8\u753b\u6210\u672c\u8f83\u9ad8\uff09\uff0c\u73b0\u5728\uff0c\u6709\u4e86<code>transitions<\/code>\uff0c\u5b9e\u73b0\u8fc7\u6e21\u6548\u679c\u5c31\u662f\u51e0\u884cCSS\u4ee3\u7801\u7684\u4e8b\u60c5\uff0c\u4e0d\u591a\u8bf4\u4e86\uff0c\u76f4\u63a5\u4e0a\u5b9e\u4f8b\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-13.html\">\u5e73\u6ed1\u9009\u9879\u5361\u5207\u6362demo<\/a><\/p>\n<p>\u5728demo\u4e2d\uff0c\u70b9\u51fb\u4e0b\u9762\u7684\u51e0\u4e2a\u56fe\u7247\u6587\u5b57\u6309\u94ae\u72b6\u7684\u4e1c\u897f\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u56fe\u7247\u6c34\u5e73\u6ed1\u8fc7\u6765\uff0c\u518d\u6ed1\u8fc7\u53bb\uff0c\u518d\u6ed1\u8fc7\u6765\uff0c\u8ba9\u4eba\u7231\u4e0d\u91ca\u624b\u554a\u3002\u4e0b\u56fe\u4e3a\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u9009\u9879\u5361\u5e73\u6ed1\u5207\u6362demo\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_225422.jpg\" title=\"\u9009\u9879\u5361\u5e73\u6ed1\u5207\u6362demo\" class=\"alignnone\" width=\"451\" height=\"368\" \/><\/p>\n<p>CSS\u5176\u4f5c\u7528\u7684\u5c31\u662f\u90a3\u4e2a\u503c\u4ee5<code>all<\/code>\u5f00\u5934\u7684<code>transition<\/code>\u5c5e\u6027\uff0c\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.trans_image_box {\n    width: 2000px;\n    height: 300px;\n    -webkit-transition: all 1s ease-in-out;\n    transition: all 1s ease-in-out;\n}\n<\/pre>\n<\/div>\n<p><code>transition<\/code> CSS\u4ee3\u7801\u7ec4\u5f88\u5403\u5f97\u5f00\u7684\u3002<\/p>\n<p>\u53ea\u8981\u662fCSS\u503c\u53d8\u6362\u7684\uff0c\u53ea\u8981\u662f\u989d\u5916\u6709<code>transition<\/code>\u5c5e\u6027\u8bbe\u7f6e\u7684\uff0c\u90fd\u662f\u5e73\u6ed1\u6548\u679c\uff0c\u90fd\u662f\u52a8\u753b\u3002\u6240\u4ee5\uff0c\u6211\u4eec\u770b\u770b\u5982\u4f55\u4ee5\u52a8\u753b\u5f62\u5f0f\u5b9e\u73b0\u7ecf\u5178\u7684\u624b\u98ce\u7434\u5207\u6362\u6548\u679c\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201011\/css3-transition-animate-demo-14.html\">\u624b\u98ce\u7434\u6548\u679cdemo<\/a>\uff08\u70b9\u51fb\u6c34\u5e73\u6807\u9898\u6709\u60ca\u559c\uff09<\/p>\n<p>\u4e0b\u4e3a\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u624b\u98ce\u7434\u6548\u679c\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/2010-11-25_230006.png\" title=\"\u624b\u98ce\u7434\u6548\u679c\u622a\u56fe\" class=\"alignnone\" width=\"426\" height=\"256\" \/><\/p>\n<p>\u5176\u4e2dJavaScript\u626e\u6f14\u7684\u89d2\u8272\u53ea\u662f\u53d8\u53d8\u9ad8\u5ea6\u503c\u800c\u5df2\uff0c\u52a8\u753b\uff0c\u90fd\u662fCSS\u4e00\u4eba\u6311\u5927\u6881\u5b8c\u6210\u7684\uff0c\u5f88\u8d5e\u5427\u3002\u4e0b\u9762\u7684\u4ee3\u7801\u5c31\u662f\u52a8\u753b\u6548\u679c\u90a3\u6bb5<code>div<\/code>\u4e0a\u7684CSS\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n.acco_content {\n    height:0;\n    padding:0 10px;\n    -webkit-transition: all 1s ease-in-out;\n    -moz-transition: all 1s ease-in-out;\n    -o-transition: all 1s ease-in-out;\n    transition: all 1s ease-in-out;\n    overflow:hidden;\n}\n<\/pre>\n<\/div>\n<p>JavaScript\u7684\u4f5c\u7528\u4e0d\u8fc7\u662f\u53d8\u53d8\u9ad8\u5ea6\u800c\u5df2\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\n$$(\".acco_title\").click(function() {\n    var rel = this.lang, cl = this.className, oOn = $$(\".acco_title_on\")[0], rel_on = oOn.lang;\n    if (!\/on\/.test(cl) && rel && rel_on) {\n       <span style=\"color:green;\"> $$(\"#\" + rel)[0].style.height = \"140px\";\n        $$(\"#\" + rel_on)[0].style.height = \"0\";<\/span>\n        this.className = \"acco_title acco_title_on\";\n        oOn.className = \"acco_title\";\n    }\n});\n<\/pre>\n<\/div>\n<h3 id=\"six\">\u516d\u3001\u6d4f\u89c8\u5668\u652f\u6301\u60c5\u51b5<\/h3>\n<div class=\"half left\">\n<h4 style=\"margin-bottom:0;\">CSS Transitions<\/h4>\n<p>\u9996\u6b21\u5f15\u5165<\/p>\n<ul id=\"ul\">\n<li>Safari 3.2: 13\/11\/2008<\/li>\n<li>Firefox 4.0: Late 2010<\/li>\n<li>Chrome 1.0: 02\/09\/2008<\/li>\n<li>Opera 10.5: 02\/03\/2010<\/li>\n<\/ul>\n<h4 style=\"margin-bottom:0;\">CSS 2D Transformations<\/h4>\n<p>\u9996\u6b21\u5f15\u5165<\/p>\n<ul id=\"ul\">\n<li>Safari 3.2: 13\/11\/2008<\/li>\n<li>Firefox 3.5: 30\/06\/2009<\/li>\n<li>Chrome 1.0: 02\/09\/2008<\/li>\n<li>Opera 10.5: 02\/03\/2010<\/li>\n<li>Internet Explore 9: 09\/2010<\/li>\n<\/ul>\n<\/div>\n<div class=\"half right\">\n<h4 style=\"margin-bottom:0;\">CSS Animations<\/h4>\n<p>\u9996\u6b21\u5f15\u5165<\/p>\n<ul id=\"ul\">\n<li>Safari 4.0: 11\/06\/2008<\/li>\n<li>Chrome 1.0: 02\/09\/2008<\/li>\n<\/ul>\n<h4 style=\"margin-bottom:0;\">CSS 3D Transformations<\/h4>\n<p>\u9996\u6b21\u5f15\u5165<\/p>\n<ul id=\"ul\">\n<li>Safari 4.0: 11\/06\/2008<\/li>\n<li>Chrome: 28\/08\/2010<\/li>\n<\/ul>\n<\/div>\n<h3 id=\"seven\">\u4e03\u3001\u53c2\u8003\u6587\u7ae0\u4ee5\u53ca\u5ef6\u4f38\u9605\u8bfb<\/h3>\n<ul id=\"ul\">\n<li><a href=\"http:\/\/www.alistapart.com\/articles\/understanding-css3-transitions\/\">Understanding CSS3 Transitions<\/a><\/li>\n<li><a href=\"http:\/\/css3.bradshawenterprises.com\/\">Using CSS3 Transitions, Transforms and Animation Intro<\/a><\/li>\n<li><a href=\"http:\/\/www.w3.org\/TR\/css3-transitions\/\">W3C: CSS Transitions Module Level 3<\/a><\/li>\n<li><a href=\"http:\/\/www.w3.org\/TR\/css3-2d-transforms\/\">W3C: CSS 2D Transforms Module Level 3<\/a><\/li>\n<li><a href=\"http:\/\/www.w3.org\/TR\/css3-3d-transforms\/\">W3C: CSS 3D Transforms Module Level 3<\/a><\/li>\n<li><a href=\"http:\/\/www.w3.org\/TR\/css3-animations\/\">W3C: CSS Animations Module Level 3<\/a><\/li>\n<li><a href=\"http:\/\/webkit.org\/blog\/\">Surfin&#8217; Safari (check the archives)<\/a><\/li>\n<li><a href=\"http:\/\/www.opera.com\/docs\/specs\/presto23\/css\/transitions\/\">CSS3 Transitions support in Opera Presto 2.3<\/a><\/li>\n<\/ul>\n<h3 id=\"eight\">\u516b\u3001\u5dee\u70b9\u5fd8\u6389\u7684\u7ed3\u8bed<\/h3>\n<p>\u867d\u7136\u76ee\u524d\u5f88\u591a\u6d4f\u89c8\u5668\u8fd8\u6ca1\u6709\u5b8c\u5168\u652f\u6301<code>transition<\/code>, <code>transform<\/code>, <code>animation<\/code>\u8fd9\u4e9b\u5c5e\u6027\uff0c\u4f46\u662f\u5728\u6e10\u8fdb\u589e\u5f3a\u7684\u539f\u5219\u4e0b\uff0c\u5176\u9ad8\u6548\u7684\u52a8\u753b\u5b9e\u73b0\u65b9\u5f0f\u8fd8\u662f\u6709\u5f88\u5b9e\u9645\u7684\u5e94\u7528\u4ef7\u503c\u7684\u3002\u4f60\u53ef\u4ee5\u4e0d\u59a8\u8bd5\u8bd5\uff0c\u70b9\u4eae\u4f60\u7684\u9875\u9762\u3002\u5185\u5bb9\u8f83\u591a\uff0c\u65f6\u95f4\u6709\u9650\uff0c\u6587\u7ae0\u96be\u514d\u6709\u8868\u8ff0\u4e0d\u51c6\u786e\u7684\u5730\u65b9\uff0c\u6b22\u8fce\u6307\u6b63\u3002<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u81ea<a href=\"http:\/\/www.zhangxinxu.com\/\">\u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<\/a>[<a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a>]<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1268\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=1268<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1268\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201011\/css3-trans-anim.jpg\" class=\"imgpad mb10\" width=\"550\" height=\"168\" \/><\/a><br \/>\n\u672c\u6587\u4ecb\u7ecdCSS3\u52a8\u753b\u76f8\u5173\u7684\u51e0\u4e2a\u5c5e\u6027\u662f\uff1atransition, transform, animation\uff0c\u5206\u522b\u7406\u89e3\u4e3a\u8fc7\u6e21\uff0c\u53d8\u6362\uff0c\u52a8\u753b\u3002\u867d\u7136\u76ee\u524d\u5f88\u591a\u6d4f\u89c8\u5668\u8fd8\u6ca1\u6709\u5b8c\u5168\u652f\u6301\u8fd9\u4e9b\u5c5e\u6027\uff0c\u4f46\u662f\uff0c\u5728\u6e10\u8fdb\u589e\u5f3a\u7684\u539f\u5219\u4e0b\uff0c\u5176\u9ad8\u6548\u7684\u52a8\u753b\u5b9e\u73b0\u65b9\u5f0f\u8fd8\u662f\u6709\u5f88\u5b9e\u9645\u7684\u5e94\u7528\u4ef7\u503c\u7684\u3002\u672c\u6587\u5b9e\u4f8b\u5f53\u5148\uff08\u517114\u4e2a\uff09\uff0c\u4f9d\u6b21\u5c55\u793atransition\u5c5e\u6027\uff0ctransform\u5c5e\u6027\uff0canimation\u5c5e\u6027\uff0c\u800c\u540e\u4e09\u8005\u7ed3\u5408\u5c55\u793a\u4e00\u4e9b\u66f4\u5b9e\u9645\u7684\u6548\u679c\u4e0e\u5e94\u7528\u3002<br \/>\n\u672c\u6587demo\u9875\u9762\u975e\u5e38\u8be6\u7ec6\uff0c\u63d0\u9ad8\u5fc5\u8981\u7684\u6e90\u4ee3\u7801\u5c55\u793a\uff0c\u548c\u622a\u56fe\u4f9b\u53c2\u8003\u3002\u5e0c\u671b\u80fd\u5bf9\u60a8\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\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":[71,531,177,137,287,288,290,140,381],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/1268"}],"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=1268"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/1268\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}