{"id":4225,"date":"2014-06-24T17:41:32","date_gmt":"2014-06-24T09:41:32","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4225"},"modified":"2018-06-15T23:43:50","modified_gmt":"2018-06-15T15:43:50","slug":"svg-path-d-polyline-points-bezier-curves","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2014\/06\/svg-path-d-polyline-points-bezier-curves\/","title":{"rendered":"SVG+JS path\u7b49\u503c\u53d8\u5316\u5b9e\u73b0CSS3\u5174\u53f9\u7684\u56fe\u5f62\u52a8\u753b"},"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=4225\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=4225<\/a><\/p>\n<h3>\u4e00\u3001CSS3\u52a8\u753b\u4ea4\u4e92\u7684\u5c40\u9650<\/h3>\n<p>CSS3\u4e5f\u80fd\u5b9e\u73b0\u5f88\u591a\u7cbe\u5f69\u7684\u52a8\u753b\u6548\u679c\uff0c\u914d\u5408<code>transform<\/code>\u65b0\u589e\u7684\u591a\u4e2a\u53d8\u6362\uff0c\u4ee5\u53ca<code>animation<\/code>\u7684\u5ef6\u65f6\u3001\u91cd\u590d\u6b21\u6570\u3001\u524d\u540e\u7aef\u72b6\u6001\u63a7\u5236\u7b49\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5f88\u591a\u7cbe\u5f69\u7684\u6548\u679c\u3002<\/p>\n<p>\u7136\u800c\uff0c\u4e5f\u662f\u6709\u5c40\u9650\u7684\u3002\u5f88\u660e\u663e\uff0cCSS3\u5bf9\u56fe\u5f62\u6240\u505a\u7684\u53d8\u5316\u6548\u679c\uff0c\u5f80\u5f80\u90fd\u662f\u57fa\u4e8e\u56fe\u5f62\u6574\u4f53\u7684\u52a8\u753b\u3002\u4ec0\u4e48\u610f\u601d\u5462\uff1f\u6bd4\u65b9\u8bf4\uff0c\u4e00\u4e2a\u56db\u8fb9\u77e9\u5f62\uff0c\u53ef\u4ee5\u8ba9\u4ed6\u634f\u6210\u8db3\u7403(<code>border-radius<\/code>\uff0c\u5706\u89d2\u77e9\u5f62)\u3001\u7136\u540e\u518d\u65cb\u8f6c\u3001\u62c9\u4f38\u6216\u8005\u7f29\u653e\uff0c\u65e0\u8bba\u8fd9\u4e9b\u52a8\u753b\u6548\u679c\u5982\u4f55\uff0c\u6211\u4eec\u4f9d\u7136\u53ef\u4ee5\u7aa5\u89c1\u5176\u56db\u6761\u8fb9\u7684\u5b58\u5728\uff0c\u867d\u7136\u53ef\u80fd\u4f4d\u7f6e\u3001\u89d2\u5ea6\u6216\u5f27\u7ebf\u4e0d\u4e00\u6837\u4e86\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u5f53\u6211\u4eec\u60f3\u628a\u56db\u8fb9\u5f62\u53d8\u6362\u6210\u4e94\u8fb9\u5f62\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u6349\u895f\u89c1\u8098\uff0c\u865a\u5f31\u4e4f\u529b\u3002\u56fe\u5f62\u672c\u8eab\u7684\u57fa\u7840\u53d8\u5316\u4e86\uff0c\u8fd9\u662fCSS3\u65e0\u6cd5\u9a7e\u9a6d\u7684\u3002<\/p>\n<p>\u6362\u4e2a\u6587\u827a\u7684\u6982\u62ec\uff0cCSS3\u5c31\u662f\u300c\u5f62\u53ef\u5f97\u800c\u795e\u4e0d\u5907\u300d\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u5bf9\u4e8e\u52a8\u5176\u7b4b\u9aa8\u7684\u56fe\u5f62\u53d8\u6362\uff0c\u5728web\u4e0a\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u501f\u52a9\u5176\u4ed6\u52bf\u529b\u7684\u529b\u91cf\uff0c\u6bd4\u65b9\u8bf4Canvas\u7ed8\u56fe\u6216\u8005SVG\u6807\u8bb0\u3002<\/p>\n<h3>\u4e8c\u3001SVG\u56fe\u5f62\u52a8\u753b<\/h3>\n<p>SVG\u672c\u8d28\u4e0a\u5c31\u662fHTML\uff0c\u80fd\u548cCSS\u537f\u537f\u6211\u6211\uff0c\u6253\u5f97\u706b\u70ed\u3002\u56e0\u6b64\uff0cCSS2\/CSS3\u7684\u4e00\u4e9b\u7279\u6027\uff0cSVG\u4e5f\u662f\u53ef\u4ee5\u53d7\u7528\u7684\u3002\u4f8b\u5982\uff0c\u5c3a\u5bf8\u53d8\u5316\uff0c\u4f4d\u7f6e\u53d8\u5316\uff0c\u5404\u79cd\u989c\u8272\u53d8\u5316\uff0c<code>transform<\/code>\u53d8\u6362\uff08\u867d\u7136SVG\u672c\u8eab\u6709\u81ea\u5df1\u7684<code>transform<\/code>\u53d8\u6362\u5c5e\u6027 &#8211; \u89c1\u4e0b\u56fe\uff09\u7b49~<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/GitHub\/demo-Snap.svg\/static\/img\/demo-snap-svg-31.png\" width=\"534\" height=\"135\" alt=\"SVG\u7684transform\u5c5e\u6027\u4e0e\u77e9\u9635\u53d8\u6362\" class=\"imgpad mt10\" \/><\/p>\n<p>\u540c\u65f6SVG\u4e00\u4e9b\u7279\u6709\u7684\u5c5e\u6027\uff0c\u4f8b\u5982<code>fill<\/code>, <code>stroke-*<\/code>\u7b49\u4e5f\u80fd\u76f4\u63a5\u5728CSS\u4e2d\u8bbe\u7f6e\uff0c\u76f8\u5f53\u5f3a\u5927\u548c\u65b9\u4fbf\u3002<span class=\"s\">\/\/zxx: \u5177\u4f53\u5e94\u7528\u53ef\u53c2\u89c1\uff1a\u201c<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4089\">\u7eafCSS\u5b9e\u73b0\u5e05\u6c14\u7684SVG\u8def\u5f84\u63cf\u8fb9\u52a8\u753b\u6548\u679c<\/a>\u201d\u4e00\u6587\u3002<\/span><\/p>\n<p>\u4e0d\u8fc7\u4e0a\u9762\u7684\u52a8\u753b\u672c\u8d28\u4e0a\u4f9d\u7136\u662f\u201cCSS3\u56fe\u5f62\u52a8\u753b\u201d\u3002\u5dee\u522b\u4ec5\u4ec5\u662f\u4f5c\u7528\u5728SVG\u5143\u7d20\u4e0a\u3002<\/p>\n<p>\u800c\u6807\u9898\u8fd9\u91cc\u7684\u201cSVG\u56fe\u5f62\u52a8\u753b\u201d\u6307\u7684\u662f\uff1a<strong>\u9700\u8981\u501f\u52a9JS\u5bf9SVG\u7279\u5b9a\u5143\u7d20\u5c5e\u6027\u503c\u505a\u8fde\u7eed\u53d8\u5316\u5b9e\u73b0\u7684\u56fe\u5f62\u52a8\u753b\u6548\u679c\u3002<\/strong> \u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u201c\u53ea\u80fd\u4f7f\u7528JS\u9a71\u52a8\u5b9e\u73b0\u7684SVG\u56fe\u5f62\u52a8\u753b\u201d\u3002<\/p>\n<p>\u4e3e\u4e2a\u5927\u529b\u795e\u676f\uff1a<br \/>\nSVG\u4e2d\u7684\u5706\u4f7f\u7528<code>&lt;circle&gt;<\/code>\u5143\u7d20\u4ee5\u53ca\u4e2d\u5fc3\u70b9\u5c5e\u6027<code>cx<\/code>, <code>cy<\/code>\u548c\u534a\u5f84\u5c5e\u6027<code>r<\/code>\u8868\u793a\u3002\u73b0\u5728\uff0c\u6211\u4eec\u60f3\u6c34\u5e73\u4f4d\u79fb200\u50cf\u7d20\uff0c\u600e\u4e48\u529e\uff1f<\/p>\n<p>\u6307\u671bCSS3\u52a8\u753b\uff1f\u5173\u952e\uff0cCSS\u770b\u5230<code>cx<\/code>\u5c31\u817f\u8f6f\uff0c\u6307\u671bCSS\u6015\u662f\u8fd8\u4e0d\u5982\u6307\u671b\u81ea\u5df1\u5bb6\u7684\u963f\u9ec4\u3002\u6b64\u65f6\uff0c\u8981\u60f3\u5bf9<code>cx<\/code>\u5c5e\u6027\u64cd\u5200\uff0c\u52bf\u5fc5\u9700\u8981JS\u5927\u4eba\u51fa\u9a6c\u3002\u8bbe\u7f6e<code>cx<\/code> <code>+=200<\/code>, \u5c31\u53ef\u4ee5\u6c34\u5e73\u53f3\u79fb200\u50cf\u7d20\u4e86\u3002<\/p>\n<p>\u6211\u628a\u8fd9\u79cdCSS\u641e\u4e0d\u5b9a\uff0cJS\u624d\u80fd\u9a71\u52a8\u7684SVG\u56fe\u5f62\u53d8\u5316\u79f0\u4e4b\u4e3a\u300cSVG\u56fe\u5f62\u52a8\u753b\u300d\u3002<\/p>\n<h3>\u4e09\u3001SVG\u56fe\u5f62\u52a8\u753b\u7406\u8bba\u57fa\u7840<\/h3>\n<p>CSS3\u9a71\u52a8\u7684\u5143\u7d20\u52a8\u753b\uff0c\u4e13\u4e1a\u672f\u8bed\u79f0\u4e3a\u201c\u8865\u95f4\u52a8\u753b\u201d\uff0c\u6307\u5b9a\u52a8\u753b\u7684\u5173\u952e\u70b9\uff0c\u5bf9\u6bd4\u5173\u952e\u70b9\u524d\u540e\u5dee\u5f02\uff0c\u5bf9\u53d8\u5316\u6570\u503c\u505a\u8fde\u7eed\u5316\u5904\u7406\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\uff0c\u4efb\u4f55\u6709\u89c4\u5f8b\u53ef\u5faa\u7684web\u52a8\u753b\uff0c\u5305\u62ecSVG\u56fe\u5f62\u52a8\u753b\uff0c\u5176\u672c\u8d28\u5b9e\u73b0\u4e0e\u4e0a\u9762\u7684\u7c7b\u4f3c\u3002\u627e\u51fa\u524d\u540e\u5dee\u5f02\uff0c\u6839\u636e\u52a8\u753b\u5f15\u64ce\u505a\u8fde\u7eed\u5316\u5904\u7406\u3002<\/p>\n<p>\u8fd8\u662f\u4e0a\u9762\u90a3\u4e2a\u5927\u529b\u795e\u676f\u7684\u4f8b\u5b50\u3002<\/p>\n<p>\u5176\u5b9e\u8981\u4f4d\u79fb\uff0c\u4f55\u9700\u52a8<code>cx<\/code>\u7684\u5e72\u6208\uff0c<code>translateX(200px)<\/code>\u5c31\u53ef\u4ee5\u6ee1\u8db3\u9700\u6c42\u3002\u6d4f\u89c8\u5668\u5185\u7f6e\u7684\u52a8\u753b\u5f15\u64ce\u53ef\u4ee5\u81ea\u52a8\u68c0\u6d4b<code>0~200<\/code>\u7684\u4f4d\u79fb\uff0c\u914d\u5408\u7f13\u52a8\u51fd\u6570\uff0c\u5c31\u6709\u6211\u4eec\u7684\u52a8\u753b\u6548\u679c\u4e86\u3002\u73b0\u5728\u95ee\u9898\u6765\u4e86\uff0c\u5982\u4f55\u6211\u4eec\u975e\u8981\u4f7f\u7528<code>cx<\/code>\u5c5e\u6027\uff08SVG <code>circle<\/code>\u5143\u7d20\u6a2a\u5750\u6807\u5c5e\u6027\uff09\u5b9e\u73b0\u5462\uff1f<\/p>\n<p>1. \u81ea\u5df1\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u52a8\u753b\u5904\u7406\u65b9\u6cd5\uff1b 2.\u4f7f\u7528\u4f18\u79c0\u7684\u5f00\u6e90\u7684\u3002<\/p>\n<p>\u51fa\u4e8e\u5b66\u4e60\u800c\u975e\u653f\u6cbb\uff0c\u52a0\u4e0a\u672c\u8eab\u6d89\u730e\u4e0d\u6df1\uff0c\u56e0\u6b64\uff0c\u81ea\u5df1\u91c7\u7528\u4e86\u7b56\u75652 &#8211; \u4f7f\u7528\u4e4b\u524d<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=3910\">\u5899\u88c2\u63a8\u8350\u7684Snap.svg.js<\/a>.<\/p>\n<p>\u5176\u4e2d\uff0c\u5bf9\u4e8e\u5143\u7d20\uff0c\u6269\u5c55\u4e86\u4e2a<code>animate()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u76f4\u63a5\u8865\u95f4\u5f62\u6210\u52a8\u753b\u6548\u679c\u3002\u5957\u7528\u4e0a\u9762\u5927\u529b\u795e\u676f\u7684\u4f8b\u5b50\uff0c\u5c31\u6709\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>circle.animate({ cx: 200 });<\/pre>\n<\/div>\n<p>\u4f4d\u79fb\u52a8\u753b\u76f4\u63a5\u5448\u73b0\uff0c\u8d85\u7b80\u5355\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u5e76\u4e0d\u662f\u6240\u6709\u7684\u53d8\u5316\u90fd\u662f\u53ef\u4ee5\u8f7b\u677e\u8865\u95f4\u7684\uff0c\u5c24\u5176\u5f53\u5c5e\u6027\u503c\u662f\u6709\u591a\u4e2a\u6570\u503c\u7ec4\u6210\u7684\u65f6\u5019\uff0c\u751a\u81f3\u8fd8\u6709\u7279\u5b9a\u6307\u4ee4\u7684\u65f6\u5019\u3002<\/p>\n<p>\u6bd4\u65b9\u8bf4\u4e0b\u9762\u8fd9\u4e24\u4e2a\u840c\u8138\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/menglian-1.jpg\" width=\"150\" height=\"150\" alt=\"\u840c\u8138\" class=\"alignnone\" \/> <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/menglian-2.jpg\" width=\"150\" height=\"150\" alt=\"\u840c\u8138\" class=\"alignnone\" \/><\/p>\n<p>\u5047\u8bbe\u5de6\u56fe\u662f\u8d77\u59cb\u6001\uff0c\u53f3\u56fe\u662f\u7ec8\u6b62\u6001\uff0c\u6765\uff0c\u7ed9\u7237\u6765\u4e2a\u8865\u95f4\uff01<\/p>\n<p>\u5475\u5475\uff0c\u50bb\u773c\u4e86\u5427\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/pa.png\" width=\"150\" height=\"150\" alt=\"\u6253\u8138\" class=\"alignnone\" \/><\/p>\n<p>\u663e\u7136\uff0c\u76ee\u524d\u6280\u672f\u6765\u770b\uff0c\u662f\u4e0d\u53ef\u80fd\u4e00\u884c\u4ee3\u7801\u5c31\u641e\u5b9a\u7684\u3002\u8981\u771f\u662f\u8fd9\u6837\uff0c\u5475\u5475\uff0c\u52a8\u753b\u516c\u53f8\u7684\u90a3\u4e9b\u5236\u4f5c\u4eba\u5458\u8981\u62c5\u5fc3\u81ea\u5df1\u7684\u996d\u7897\u4e86\uff0c\u4eba\u4eba\u90fd\u662f\u52a8\u753b\u5e08\u7684\u8282\u594f\u554a\uff01<\/p>\n<p>\u4f46\u662f\uff0c\u7406\u8bba\u4e0a\uff0c\u4e0a\u9762\u5982\u6b64\u590d\u6742\u7684\u56fe\u5f62\u8865\u95f4\u4e5f\u662f\u53ef\u4ee5\u5b9e\u73b0\u7684\u3002<\/p>\n<p>\u8fd9\u5c31\u9700\u8981\u6df1\u5165\u56fe\u5f62\u7684\u672c\u6e90\u4e86\u3002<\/p>\n<p>SVG\u4e2d\uff0c\u89c4\u5219\u56fe\u5f62\uff0c\u4f8b\u5982\uff0c\u8db3\u7403\u3001\u7403\u95e8\u90fd\u662f\u6709\u7279\u5b9a\u7684\u5143\u7d20\u7684\uff0c\u8fd9\u4e9b\u662f\u5e38\u7528\u56fe\u5f62\uff0c\u4e3a\u7684\u662f\u5feb\u901f\u65b9\u4fbf\u6784\u5efa\u3002\u4e0d\u89c4\u5219\u56fe\u5f62\uff0c\u4f8b\u5982\uff0c\u840c\u8138\u7684\u66f2\u9762\u8138\u86cb\uff0cC\u7f57\u7684\u5634\u578b\uff0c\u4e00\u822c\u90fd\u662f\u4f7f\u7528\u4e07\u80fd\u7684<code>path<\/code>\u5143\u7d20\u5b9e\u73b0\u3002<code>path<\/code>\u5143\u7d20\u53ef\u4ee5\u5b9e\u73b0\u4efb\u610f\u89c4\u5219\u6216\u4e0d\u89c4\u5219\u7684\u7ebf\u3001\u9762\u3002<\/p>\n<p>\u800c\u8fd9\u4e9b\u7ebf\u3001\u9762\u672c\u8d28\u4e0a\u5c31\u662f<code>path<\/code>\u5143\u7d20\u7684<code>d<\/code>\u5c5e\u6027\u503c\u7684\u00b7\u4e00\u7cfb\u5217\u5750\u6807\u53c2\u6570+\u7279\u5b9a\u6307\u4ee4\u00b7\u6784\u5efa\u7684\u3002\u56e0\u6b64\uff0c\u5de6\u840c\u8138\u7684\u672c\u8d28\u53ef\u80fd\u662f\u5750\u6807<code>a b c<\/code>\uff0c\u53f3\u840c\u8138\u7684\u672c\u8d28\u53ef\u80fd\u662f\u5750\u6807<code>d e f<\/code>\uff0c\u6211\u4eec\u53ea\u8981\u627e\u5230\u4e24\u4e2a\u5750\u6807\u7684\u67d0\u4e9b\u5173\u8054\u89c4\u5f8b\uff0c\u5c31\u80fd\u5b9e\u73b0\u8865\u95f4\u6548\u679c\uff0c\u4e5f\u5c31\u662fSVG\u56fe\u5f62\u52a8\u753b\u6548\u679c\u4e86\u3002<\/p>\n<p>\u6587\u5b57\u8981\u5f00\u82b1\u7684\u8282\u594f\uff0c\u8d76\u5feb\u63d2\u64ad\u4e86\u4e2a\u4f8b\u5b50\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201404\/2014-06-24_svg-shape-animation-one-point.gif\" width=\"461\" height=\"429\" alt=\"\u7b80\u5355\u7684SVG\u56fe\u5f62\u52a8\u753b\u4e00\u4f8b\" class=\"mt10\" \/><\/p>\n<p>\u4e0a\u56feGif\u6548\u679c\uff0c\u5c31\u662f\u5bf9\u8def\u5f84\u7684\u67d0\u4e00\u70b9\u505a\u6709\u89c4\u5f8b\u7684\u8fd0\u52a8\u5f62\u6210\u7684\u52a8\u753b\u6548\u679c\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" href=\"http:\/\/www.zhangxinxu.com\/study\/201406\/svg-animation-a-simple-shape.html\" target=\"_blank\">\u4e00\u4e2a\u7b80\u5355\u7684SVG\u8def\u5f84\u70b9\u53d8\u5316\u52a8\u753b\u6548\u679cdemo<\/a><\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u4e94\u8fb9\u5f62\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>path<\/code>\u7684<code>M<\/code>\u548c<code>L<\/code>\u6307\u4ee4\u8fdb\u884c\u7ed8\u5236\uff08\u8def\u5f84\u6307\u4ee4\u53ef<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4197\">\u53c2\u89c1\u8fd9\u7bc7\u6587\u7ae0<\/a>\uff09\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u521a\u5f00\u59cb\uff0c\u6e29\u6c34\u7096\u9752\u86d9\uff0c\u86af\u8693\u9493\u86e4\u87c6\uff0c\u4e00\u4e0a\u6765\u5c31<code>path<\/code>\u6307\u4ee4\u4f1a\u5413\u7740\u82b1\u82b1\u8349\u8349\u4ee5\u53ca\u8def\u8fc7\u7684\u5c0f\u670b\u53cb\u7684\uff0c\u56e0\u6b64\uff0c\u8fd9\u91cc\u4f7f\u7528<code>polyline<\/code>\u591a\u8fb9\u5f62\u5143\u7d20\uff0c\u4f7f\u7528<code>points<\/code>\u5c5e\u6027\u6807\u8bb0\u70b9\u3002\u4f8b\u5982\uff0c\u4e0a\u9762\u7684demo\u9ed8\u8ba4\u4e94\u8fb9\u5f62\u7684\u70b9\u4f4d\u7f6e\u662f\uff08\u663e\u793a\u5668\u5c3a\u5bf8\u4e0d\u4e00\u6837\uff0c\u503c\u4e5f\u4e0d\u4e00\u6837\uff0c\u56e0\u6b64\uff0c\u4ec5\u793a\u610f\uff09\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;polyline points='<span style=\"color:#cd0000;\">798,432<\/span>,<span style=\"color:#369;\">1022,360<\/span>,<span style=\"color:#cd0000;\">1160,549<\/span>,<span style=\"color:#369;\">1021,740<\/span>,<span style=\"color:#cd0000;\">798,667<\/span>' fill=\"rgba(255,255,255,0.85)\">&lt;\/polyline><\/pre>\n<\/div>\n<p>\u4e0a\u9762\u989c\u8272\u9ad8\u4eae\u76845\u4e2a\u5750\u6807\u5c31\u662f\u4e94\u8fb9\u5f62\u76845\u4e2a\u9876\u70b9\u5750\u6807\u3002<\/p>\n<p>\u8981\u5b9e\u73b0Gif\u6240\u793a\u7684\u6548\u679c\uff0c\u539f\u7406\u5f88\u7b80\u5355\uff0c\u53ea\u8981\u8ba9\u7b2c3\u4e2a\u70b9\u6c34\u5e73\u4f4d\u79fb\u5c31\u597d\u4e86\u3002<\/p>\n<p>\u672c\u8d28\u4e0a\u5c31\u4e0e\u5927\u529b\u795e\u676f\u7684\u90a3\u4e2a\u5706\u5708\u4f4d\u79fb\u662f\u4e00\u6837\u7684\u3002\u53ea\u662f\uff0c\u5927\u529b\u795e\u676f\u72ec\u7acb\u53c2\u6570\uff0c\u8fd9\u91cc\u662f\u4f17\u591a\u53c2\u6570\u4e2d\u7684\u4e00\u4e2a\u3002<\/p>\n<p>\u8fd9\u91cc\uff0c\u6211\u4eec\u65e0\u6cd5\u76f4\u63a5\u5bf9\u6574\u4e2a\u5c5e\u6027\u5750\u6807\u505a\u8865\u95f4\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u539f\u751f\u7684\u5750\u6807\u52a8\u753b\u65b9\u6cd5\u3002<\/p>\n<p><a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=3910\">Snap.svg.js<\/a>\u4e2d\u6709\u4e2a\u5168\u5c40\u7684<code>animate()<\/code>\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5<a href=\"http:\/\/www.zhangxinxu.com\/GitHub\/demo-Snap.svg\/demo\/basic\/Snap.animate.php\">\u4e2d\u6587\u6587\u6863\u6233\u8fd9\u91cc<\/a>\u3002<\/p>\n<p>\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>Snap.animate(from, to, setter, duration, [easing], [callback]);<\/pre>\n<\/div>\n<p>\u4e0a\u9762\u4ecb\u7ecd\u7684<a href=\"http:\/\/www.zhangxinxu.com\/GitHub\/demo-Snap.svg\/demo\/basic\/Element.animate.php\">Element.animate()<\/a>\u65b9\u6cd5\u5c31\u662f\u6839\u636e\u8fd9\u4e2a\u5e95\u5c42\u65b9\u6cd5\u6f14\u53d8\u800c\u6765\u3002\u5176\u5173\u7cfb\uff0c\u7c7b\u4f3c\u4e8ejQuery\u4e2d<code>$.get()\/$.post()<\/code>\u548c<code>$.ajax()<\/code>\u7684\u5173\u7cfb\u3002<\/p>\n<p>\u5982\u679c\u5957\u7528\u5927\u529b\u795e\u676f\u504f\u79fb200\u50cf\u7d20\u7684\u4f8b\u5b50\uff0c\u5219\u6709\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>Snap.animate(0, 200, function (val) {\n   circle.attr({\n        cx: val\n   });\n}, 500);<\/pre>\n<\/div>\n<p><code>Snap.animate()<\/code>\u65b9\u6cd5\u5f3a\u5927\u4e4b\u5904\u5728\u4e8e\u8fd9\u4e2a<code>setter<\/code>\u8fd9\u4e2a\u51fd\u6570\uff0c\u52a8\u753b\u5f15\u64ce\u7684\u6838\u5fc3\u5c31\u662f\u8ba1\u7b97\u7279\u5b9a\u65f6\u95f4\u70b9\u7684\u7279\u5b9a\u5750\u6807\u503c\uff08\u989c\u8272\u503c\u3001\u5c3a\u5bf8\u503c\uff09\u7b49\uff0c\u800c\u8fd9\u4e2a\u51fd\u6570\uff0c\u53ef\u4ee5\u5b9e\u65f6\u8fd4\u56de\u5f53\u524d\u9700\u8981\u7684\u5750\u6807\u503c\uff0c\u4e8e\u662f\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u6309\u7167\u7279\u5b9a\u7684\u4f4d\u7f6e\u5173\u7cfb\u3001\u8fd0\u52a8\u51fd\u6570\u7b97\u6cd5\uff0c\u6c42\u5f97\u6574\u4f53\u56fe\u5f62\u7684\u8fd0\u52a8\u5750\u6807\uff0c\u4ece\u800c\u5f62\u6210\u5b8c\u6574\u7684\u52a8\u753b\u6548\u679c\u3002<\/p>\n<p>\u5bf9\u4e8e\u8fd9\u91cc\u7684\u56fe\u5f62\u53d8\u6362\uff0c\u662f\u975e\u5e38\u7b80\u5355\u7684\uff0c\u7eaf\u7cb9\u7b2c\u4e09\u4e2a\u70b9\u6c34\u5e73\u4f4d\u79fb\u5230\u4e2d\u5fc3\u70b9\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/five-points.png\" width=\"320\" height=\"268\" alt=\"5\u70b9\u5750\u6807\u53d8\u6362\" class=\"alignnone\" \/><\/p>\n<p>\u5957\u7528<code>Snap.animate()<\/code>\u65b9\u6cd5\u5c31\u662f\uff08\u5047\u8bbe\u534a\u5f84\u662f200\uff09\uff08\u4e0b\u9762\u5199\u6cd5\u7eaf\u793a\u610f\uff0c\u4e0d\u8981\u592a\u8ba4\u771f\uff09\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>Snap.animate(200, 0, funciton(val) {\n    polygon.attr({\n        points: \"\u70b91, \u70b92, (\u4e2d\u5fc3\u70b9x\u5750\u6807 + val, \u70b93 y\u5750\u6807), \u70b94, \u70b95\"\n    });\n}, 300, mina.backout);<\/pre>\n<\/div>\n<p>\u5177\u4f53\u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u201c\u53f3\u952e\u9875\u9762\u2192\u67e5\u770b\u6e90\u4ee3\u7801\u201d\uff0c\u4e0d\u8981\u518d\u90ae\u4ef6\u6211\u8981\u6e90\u4ee3\u7801\u4e86\uff0c\u8bf8\u4f4d\uff01<\/p>\n<p>OK, \u4ee5\u4e0a\u5c31\u662fSVG\u56fe\u5f62\u52a8\u753b\u7406\u8bba\u57fa\u7840\uff1a\u4f7f\u7528\u52a8\u753b\u5f15\u64ce\u65b9\u6cd5(\u5982Snap.svg\u7684<code>Snap.animate()<\/code>\u65b9\u6cd5)\uff0c\u6539\u53d8\u7279\u70b9\u65f6\u95f4\u70b9\u7684\u7279\u5b9a\u53c2\u6570\u503c\uff0c\u5e76\u5b9e\u65f6\u5237\u65b0\u3002<\/p>\n<h3>\u56db\u3001\u66f4\u5b9e\u9645\u7684SVG\u56fe\u5f62\u52a8\u753b\u5b9e\u4f8b<\/h3>\n<p>\u5148\u7785\u7785Gif\u622a\u56fe\u6548\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201404\/2014-06-24_1514-svg-shape-animation-hover.gif\" width=\"320\" height=\"320\" alt=\"SVG\u56fe\u5f62\u52a8\u753b\u622a\u5c4f\u6548\u679c\" class=\"alignnone\" \/><\/p>\n<p>\u4e0a\u56fe\u6548\u679c\u5c31\u662f\u67d0\u5b9e\u9645\u9879\u76ee\u4e2d\u5b9e\u73b0\u7684\u6548\u679c\u793a\u610f\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" href=\"http:\/\/www.zhangxinxu.com\/study\/201406\/svg-animation-img-hover-effect.html\" target=\"_blank\">SVG path d\u8def\u5f84\u53c2\u6570\u53d8\u5316\u4e0e\u56fe\u5f62\u52a8\u753bdemo<\/a><\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u4f2a\u7ffb\u9875\u6548\u679c\uff0c\u8bbe\u8ba1\u5e08\u505a\u4e86\u6b64\u6548\u679c\u89c6\u9891\u3002\u663e\u7136\uff0c\u8bbe\u8ba1\u5e08\u5982\u6b64\u7ed9\u529b\uff0c\u8eab\u4e3a\u524d\u7aef\uff0c\u5fc5\u987b\u9ad8\u4fdd\u771f\u5b9e\u73b0\u3002\u6b64\u5904\uff0cCSS3\u663e\u7136\u662f\u65e0\u80fd\u4e3a\u529b\u7684\uff0c\u56e0\u4e3a\u6298\u89d2\u6709\u5185\u51f9\u72b6\u6001\uff08\u89c1\u4e0b\u6355\u6349\u622a\u56fe\uff09\uff0c\u4f46\u662f\uff0c\u5bf9\u4e8eSVG\u56fe\u5f62\u52a8\u753b\uff0c\u8fd9\u5c31\u662f\u4e2a\u5c0f\u513f\u79d1\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/2014-06-24_155830.png\" width=\"320\" height=\"320\" alt=\"\u5185\u51f9\u6548\u679c\u622a\u56fe\u6f14\u793a\" class=\"alignnone\" \/><\/p>\n<p>\u753b\u4e2a\u793a\u610f\u56fe\uff0c\u5176\u5b9e\u5b9e\u73b0\u539f\u7406\u76f8\u5f53\u7b80\u5355\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/image-explain-svg-hover-effect.png\" width=\"660\" height=\"370\" alt=\"hover\u6548\u679c\u53d8\u6362\u793a\u610f\u56fe\" class=\"mt10\" \/><\/p>\n<p>\u5176\u5b9e\u8ddf\u4e0a\u9762\u7684\u4e94\u8fb9\u5f62\u6548\u679c\u7c7b\u4f3c\uff0c\u90fd\u662f\u67d0\u4e00\u4e2a\u70b9\u6cbf\u7740\u7279\u5b9a\u7684\u8f68\u8ff9\u8fd0\u52a8\uff0c\u56fe\u5f62\u4e0d\u65ad\u6e32\u67d3\u5f62\u6210\u52a8\u753b\u6548\u679c\u3002<\/p>\n<p>\u53ea\u662f\u8fd9\u91cc\u662f4\u4e2a\u70b9\uff0c\u70b9\u7684\u8fd0\u52a8\u8f68\u8ff9\u662f\u4e2a\u659c\u7ebf\u800c\u5df2\u3002<\/p>\n<p>\u659c\u7ebf\u7684\u51fd\u6570\u65b9\u7a0b\u5f0f\u5e94\u8be5\u90fd\u8bb0\u5f97\u5427\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>y = a*x + b;<\/pre>\n<\/div>\n<p>\u6211\u4eec\u77e5\u9053SVG\u53f3\u4e0a\u89d2\u548c\u5de6\u4e0b\u89d2\u7684\u5750\u6807\uff0c\u4e0a\u9762\u7684<code>a<\/code>\u548c<code>b<\/code>\u901f\u901f\u5c31\u8ba1\u7b97\u51fa\u6765\u4e86\u3002\u4e0d\u5c55\u5f00\u3002<\/p>\n<p>\u8fd8\u662f<code>Snap.animate()<\/code>\u65b9\u6cd5\uff0c\u5c55\u5f00\u7684\u76f8\u5173JS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre><span style=\"color:green;\">\/\/ \u56fe\u5f62\u5c55\u5f00<\/span>\nSnap.animate(svg_width, 0, function(x) {\n    var p4 = [x, a * x + b].join(\" \");\n    <span style=\"color:green;\">\/\/ \u8def\u5f84\u53d8\u5316\u8d70\u8d77<\/span>\n    <span style=\"color:green;\">\/\/ M p1 L p2 L p3 L p4 L p1Z<\/span>\n    path.attr({\n        d: \"M\" + [p1, p2, p3, p4, p1].join(\"L\") + \"Z\"\n    });\n}, 200, mina.easein);\n<\/pre>\n<\/div>\n<p>\u54c8\uff0c\u8fd9\u91cc\u4e3a\u4e86\u627f\u4e0a\u542f\u4e0b\uff0c\u4f7f\u7528\u4e86<code>path<\/code>\u8def\u5f84\u5143\u7d20\u3002\u5982\u679c\u4f60\u60f3\u66f4\u7b80\u5355\u5b9e\u73b0\uff0c\u53ef\u4ee5\u4f7f\u7528<code>polyline<\/code>\u5143\u7d20+<code>points<\/code>\u5c5e\u6027\u3002<\/p>\n<p>\u7b80\u5355\u5427~<\/p>\n<p>\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u5c55\u793a\u7684\u4e24\u4e2a\u6548\u679c\u90fd\u662f\u53ea\u6709\u4e00\u4e2a\u70b9\u53d8\u5316\uff0c\u662f\u4e0d\u662f\u89c9\u5f97\u6ca1\u6709\u4ec0\u4e48\u6311\u6218\u6027\u554a\uff1f\u54c8\uff0c\u90a3\u4e0b\u9762\u6211\u4eec\u518d\u770b\u4e00\u4e2a\u591a\u70b9\u8054\u52a8\u53d8\u5316\u7684\u590d\u6742\u4f8b\u5b50\u3002<\/p>\n<h3>\u4e94\u3001\u591a\u70b9\u8054\u52a8\u7684\u590d\u6742SVG\u56fe\u5f62\u52a8\u753b\u5b9e\u4f8b<\/h3>\n<p>\u5916\u7525\u70b9\u706f\u7b3c-\u7167\u65e7(\u8205)\uff0c\u5148\u4e0a\u4e00\u4e2aGif\uff0c\u4e0b\u56fe\u4e3a\u7f29\u5c0f\u7248\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201404\/2014-06-24_1635-svg-shape-pandora.gif\" width=\"341\" height=\"223\" alt=\"\u6f58\u591a\u62c9\u6548\u679cGif\u793a\u610f\" class=\"mt10\" \/><\/p>\n<p>\u4e0a\u56fe\u8fd9\u79cd\u4ece\u76d2\u5b50\u5c55\u5f00\u4ee5\u53ca\u6536\u5165\u76d2\u5b50\u7684\u6548\u679c\uff0c\u6211\u79f0\u4e4b\u4e3a\u201c\u6f58\u591a\u62c9\u6548\u679c\u201d\u2014\u2014\u6253\u5f00\u6f58\u591a\u62c9\u7684\u76d2\u5b50\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" href=\"http:\/\/www.zhangxinxu.com\/study\/201406\/svg-animation-pandora-improve.html\" target=\"_blank\">SVG\u6f58\u591a\u62c9\u56fe\u5f62\u52a8\u753b\u6548\u679cdemo<\/a><\/p>\n<p>\u7b2c\u4e00\u6b21\u8f7d\u5165\u4f4d\u7f6e\u662f\u56fa\u5b9a\u7684\uff0c\u5982\u679c\u6709\u70b9\u51fb\u884c\u4e3a\uff0c\u5219\u540e\u9762\u5237\u65b0\u7684\u65f6\u5019\uff0c\u5de5\u5177\u680f\u4ee5\u53caChrome\u56fe\u6807\u7684\u4f4d\u7f6e\u5c31\u4f1a\u968f\u673a\uff0c\u4f60\u4f1a\u53d1\u73b0\uff0c\u65e0\u8bba\u5728\u4f55\u65b9\uff0c\u6f58\u591a\u62c9\u90fd\u4f1a\u4ee5\u6b63\u786e\u7684\u65b9\u5f0f\u6253\u5f00\u3002\u5f53\u504f\u79fb\u4f4d\u7f6e\u8f83\u5927\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u770b\u5230\u660e\u663e\u7684\u8fb9\u7f18\u5f27\u7ebf\uff0c\u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u4e86\u4e8c\u6b21\u8d1d\u585e\u5c14\u66f2\u7ebf\u7684\u7f18\u6545\u3002<\/p>\n<p><strong>\u5b9e\u73b0\u539f\u7406<\/strong><br \/>\n\u539f\u7406\u4e0e\u4e0a\u9762\u7684\u4e24\u4e2a\u4f8b\u5b50\u7c7b\u4f3c\uff0c\u4e0d\u540c\u4e4b\u5904\u5728\u4e8e\uff0c\u8fd9\u91cc\uff0cSVG\u56fe\u5f62\u76848\u4e2a\u70b9\u8981\u540c\u65f6\u8fd0\u52a8\uff0c\u800c\u4e0d\u662f\u53ea\u67091\u4e2a\u70b9\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u76d2\u5b50\u8981\u6536\u8d77\u7684\u65f6\u5019\uff0c8\u4e2a\u70b9\u4f9d\u6b21\u5954\u5411\u76d2\u5b50\uff0c\u586b\u5145\u8def\u5f84\u5b9e\u65f6\u6e32\u67d3\uff0c\u5c31\u6709\u4e86\u6211\u4eec\u770b\u5230\u7684\u6548\u679c\u4e86\u3002<\/p>\n<p>\u5982\u679c\u8981\u5177\u4f53\u5c55\u5f00\uff0c\u6211\u52d2\u4e2a\u53bb\uff0c\u4f30\u8ba1\u8981\u4e0a\u767e\u884c\u5f00\u5916\u4e86\u3002\u7bc7\u5e45\u5df2\u7ecf\u5f88\u957f\uff0c\u8fd9\u91cc\u7b80\u5355\u63d0\u51e0\u4e2a\u8981\u70b9\uff1a<\/p>\n<ol>\n<li>\u540c\u6837\uff0c\u8fd8\u662f\u4f9d\u8d56\u4e8eSnap.svg.js\u7684<code>Snap.animate()<\/code>\u65b9\u6cd5\uff0cdemo\u4e2d\u6709\u4f7f\u7528\u5176\u56de\u8c03\u65b9\u6cd5\u3002<\/li>\n<li>\u53ea\u80fd\u662f<code>path<\/code>\u5143\u7d20\uff0c\u9664\u4e86\u8d77\u59cb\u70b9\u548c\u95ed\u5408\u70b9\uff08\u540c\u4e00\u70b9\uff09\uff0c\u5176\u5b9e\u5747\u662f\u4e8c\u6b21\u8d1d\u585e\u5c14\u66f2\u7ebf\u6307\u4ee4(<code>Q<\/code>)\u5750\u6807\u3002<span class=\"s\">\/\/zxx: \u8d1d\u585e\u5c14\u66f2\u7ebf\u6307\u4ee4\u53ef\u53c2\u8003\u524d\u4e00\u7bc7\u6587\u7ae0\u201c<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4197\">\u6df1\u5ea6\u638c\u63e1SVG\u8def\u5f84path\u7684\u8d1d\u585e\u5c14\u66f2\u7ebf\u6307\u4ee4<\/a>\u201d\u3002\u4e8c\u6b21\u8d1d\u585e\u5c14\u66f2\u7ebf\u6307\u4ee4\u7ed8\u5236\u76f4\u7ebf\u53ea\u8981\u5bf9\u5e94\u65b9\u4f4d\u5750\u6807\u503c\u4e00\u81f4\u5c31\u53ef\u4ee5\u3002<\/span>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/pandora-command.png\" width=\"240\" height=\"195\" alt=\"\u6f58\u591a\u62c9\u6548\u679c\u4e0e\u8def\u5f84\u5404\u4e2a\u70b9\u6307\u4ee4\" class=\"alignnone\" \/><\/li>\n<li>\u6bcf\u4e00\u4e2a\u70b9\u5bf9\u5e94\u4e00\u4e2a\u8fd0\u52a8\u51fd\u6570\uff0c\u672cdemo\u4f7f\u7528\u7684\u662f\u7ebf\u6027\u8fd0\u52a8\u51fd\u6570\uff0c\u4e5f\u5c31\u662f\u4e0a\u9762\u63d0\u5230\u7684\uff1a\n<div class=\"zxx_code\">\n<pre>y = a*x + b;<\/pre>\n<\/div>\n<p>\u5f53\u7136\uff0c\u5982\u679c\u4f60\u6570\u5b66\u8db3\u591f\u597d\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u66f2\u7ebf\u51fd\u6570\uff0c\u6548\u679c\u4f1a\u66f4funny!\n<\/li>\n<li>\u5782\u76f4\u8fd0\u52a8\uff0c\u6240\u6709\u5750\u6807\u90fd\u662f\u8ddf\u5bf9\u7eb5\u5750\u6807\u4e5f\u5c31\u662f<code>y<\/code>\u5750\u6807\u53d8\u5316\u800c\u53d8\u5316\uff0c\u6c34\u5e73\u8fd0\u52a8\u5219\u662f<code>x<\/code>\u5750\u6807~<\/li>\n<li>\u4e2d\u95f4\u7684Q\u70b9\u5e76\u4e0d\u662f\u5b8c\u5168\u5c45\u4e2d\u7684\uff0cdemo\u4e2d\u662f<code>1\/4<\/code>\u8fdc\u7aef\u504f\u79fb\u7684\uff0c\u4e3a\u7684\u662f\u66f4\u81ea\u7136\u7684\u5c0f\u66f2\u9762\u6548\u679c\u3002<\/li>\n<li>\u8fd0\u52a8\u7684\u7ec8\u70b9\uff0c\u4e5f\u5c31\u662f\u76d2\u5b50\u7684\u5750\u6807\u5b9e\u9645\u4e0a\u53ea\u662f\u4e00\u6761\u8fb9\u7f18\u7ebf\u3002\u6211\u66fe\u8bd5\u8fc7\u4e2d\u5fc3\u70b9\u6216\u6574\u4f53\u77e9\u5f62\uff0c\u4f46\u6548\u679c\u90fd\u4e0d\u597d\u3002<\/li>\n<li>\u6bcf\u4e2a\u6c34\u5e73\u9762\uff08\u5782\u76f4\u8fd0\u52a8\uff09\u6216\u5782\u76f4\u9762\uff08\u6c34\u5e73\u8fd0\u52a8\uff09\u7684\u70b9\u662f\u540c\u4e00\u5bf9\u5e94\u65b9\u4f4d\u5750\u6807\uff0c\u5176\u8fd0\u52a8\u542f\u52a8\u65f6\u95f4\u662f\u6709\u5148\u540e\u4e4b\u5206\u7684\uff0c\u542f\u52a8\u65f6\u95f4\u7684\u5148\u540e\u4e0e\u5c55\u793a\u7684\u9762\u677f\/\u5f39\u6846\u7684\u5c3a\u5bf8\u76f8\u5173\u3002\u4e00\u8a00\u96be\u5c3d\uff0c\u4e0d\u591a\u8bf4\u4e86\u3002<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a~~\u5982\u679c\u6709\u5176\u4ed6\u95ee\u9898\uff0c\u6b22\u8fce\u8bc4\u8bba\u5f62\u5f0f\u4ea4\u6d41\u3002<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u8981\u6e90\u4ee3\u7801\uff0c\u76f4\u63a5[\u53f3\u952e\u2192\u67e5\u770b\u9875\u9762\u6e90\u4ee3\u7801]\u5c31\u53ef\u4ee5\u4e86\uff0c\u6709\u8d85\u8be6\u7ec6\u7684\u6ce8\u91ca\uff08\u542b\u5b9e\u73b0\u601d\u8def\uff09\uff0c\u6bd4\u770b\u6587\u7ae0\u91cc\u7684\u5520\u53e8\u6709\u7528\u3002<\/p>\n<p>\u6b64\u6f58\u591a\u62c9\u6548\u679c\u7684\u6838\u5fc3\u65b9\u6cd5\u5df2\u7ecf\u5b8c\u5168\u5c01\u88c5\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u4e0d\u4f9d\u8d56\u4efb\u4f55JS\u6846\u67b6\u5e93\uff0c\u9700\u8981IE9+\u6d4f\u89c8\u5668\u652f\u6301\u3002\u6ce8\u610f\uff0c\u8fd9\u91cc\u53ea\u662f\u6838\u5fc3\u65b9\u6cd5\u5c01\u88c5\uff08\u4e5f\u5c31\u662f\u52a8\u753b\u90e8\u5206\uff09\uff0c\u5982\u679c\u4f60\u60f3\u63d2\u4ef6\u5316\uff0c\u9700\u8981\u628a\u4e00\u4e9b\u53c2\u6570\u63d0\u51fa\u6765\uff0c\u4e3b\u8981\u662f\u4e24\u4e2a\u5143\u7d20\uff0c\u504f\u79fb\u6bd4\u4f8b\u4ee5\u53ca\u8fd0\u52a8\u65b9\u4f4d\uff0c\u76f8\u4fe1\u4e0d\u662f\u96be\u4e8b\u3002<\/p>\n<h3>\u516d\u3001\u7ed3\u675f\u8bed<\/h3>\n<p>\u6211\u6e05\u695a\u7684\u8bb0\u5f97\u6709\u7bc7\u6587\u7ae0\u7684\u7ed3\u675f\u8bed\u63d0\u5230\u4e86\u4e16\u754c\u676f\u6bd4\u8d5b\uff0c\u53ef\u89c1\uff0c\u6211\u8fd9\u7a7a\u95f4\u81f3\u5c11\u6d3b\u8e66\u4e71\u8df3\u4e864\u5e74\u3002\u65f6\u95f4\u55d6\u5f97\u4e00\u58f0\uff0c\u53d1\u73b0\u5df2\u7ecf\u662f2018\u5e74\u4e16\u754c\u676f\u4e86\u3002\u90a3\u4e2a\u65f6\u5019\u6211\u5728\u505a\u4ec0\u4e48\u5462\uff1fwho knows! \u671d\u7740\u81ea\u5df1\u7684\u76ee\u6807\u4e0e\u65b9\u5411\uff0c\u8d70\u597d\u811a\u4e0b\u7684\u8def\u3002<\/p>\n<p>\u4e16\u754c\u676f\u7684\u6bcf\u4e00\u573a\u6bd4\u8d5b\u6211\u90fd\u770b\u4e86\uff0c\u4e0d\u8981\u5d07\u62dc\u54e5\uff0c\u56e0\u4e3a\u54e5\u770b\u7684\u90fd\u662f\u8fdb\u7403\u96c6\u9526\u3002\u8bdd\u8bf4\u6211\u4ee5\u524d\u7684\u540c\u4e8b\u5728\u8d4c\u7403\uff0c\u7531\u4e8e\u4e4b\u524d\u51b7\u95e8\u592a\u591a\uff0c\u6240\u4ee5\u6628\u513f\u4e2a\u5168\u538b\u5df4\u897f\u8f93\uff0c\u8377\u5170\u8f93\uff0c\u7136\u540e\uff0c\u4eca\u5929\u5c31\u5728\u529e\u516c\u697c\u9876\u697c\u5439\u4e86\u534a\u664c\u7684\u98ce\u3002<img decoding=\"async\" src=\"http:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/181.gif\" align=\"absmiddle\"><\/p>\n<p>\u8ba1\u5212\u534a\u5e74\u519920\u7bc7\u6587\u7ae0\u7684\uff0c\u8fd8\u5dee\u4e24\u7bc7\uff0c\u53ea\u6709\u4e00\u5468\u7684\u65f6\u95f4\uff0c\u5468\u672b\u8fd8\u8981\u56de\u4e08\u6bcd\u5a18\u5bb6\uff0c\u600e\u4e48\u529e\u5462\u2026\u2026<img decoding=\"async\" src=\"http:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/40.gif\" align=\"absmiddle\"><\/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=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4225\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=4225<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4225\" title=\"\u70b9\u51fb\u67e5\u770b\u672c\u6587\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201406\/svg-animate-cover.jpg\" width=\"550\" height=\"170\" alt=\"\u6570\u503c\u53d8\u5316\u9a71\u52a8\u7684SVG\u56fe\u5f62\u52a8\u753b\" class=\"imgpad\" \/><\/a><\/p>\n<p>\u5c55\u793aSVG\u52a8\u753b\u7684\u4f18\u52bf\u4e0e\u6f5c\u529b\uff0c\u4ecb\u7ecdSVG\u52a8\u753b\u5b9e\u73b0\u7684\u57fa\u672c\u7406\u8bba\uff0cSnap.svg.js\u8fdb\u4e00\u6b65\u7684\u5b9e\u4f8b\u5e94\u7528\u5c55\u793a\u3002\u591a\u591ademo\uff0c\u591a\u591a\u5e05\u6c14\u7684\u6548\u679c\uff0c\u591a\u591a\u901a\u4fd7\u6613\u61c2\u7684\u89e3\u91ca\u3002\u5e0c\u671b\u672c\u6587\u7684\u5185\u5bb9\u80fd\u591f\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":[895],"tags":[922,925,642,924,859,919],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/4225"}],"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=4225"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/4225\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=4225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=4225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=4225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}