{"id":85,"date":"2016-07-07T21:44:10","date_gmt":"2016-07-07T13:44:10","guid":{"rendered":"https:\/\/blog.lcsoul.cn\/?p=85"},"modified":"2016-07-07T21:44:10","modified_gmt":"2016-07-07T13:44:10","slug":"%e7%a7%bb%e5%8a%a8h5%e5%89%8d%e7%ab%af%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/blog.lcsoul.top\/index.php\/2016\/07\/07\/%e7%a7%bb%e5%8a%a8h5%e5%89%8d%e7%ab%af%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%e6%8c%87%e5%8d%97\/","title":{"rendered":"\u79fb\u52a8H5\u524d\u7aef\u6027\u80fd\u4f18\u5316\u6307\u5357"},"content":{"rendered":"<h1 style=\"text-align: center;\"><a href=\"https:\/\/blog.lcsoul.top\/image\/20160707\/web-optimization-01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full\" src=\"https:\/\/blog.lcsoul.top\/image\/20160707\/web-optimization-01.png\" alt=\"web-optimization-01.png\" width=\"910\" height=\"295\" \/><\/a><\/h1>\n<p><!--more--><\/p>\n<h2 style=\"text-align: center;\">\u79fb\u52a8H5\u524d\u7aef\u6027\u80fd\u4f18\u5316\u6307\u5357<\/h2>\n<h2><strong>\u6982\u8ff0<\/strong><\/h2>\n<p>1. PC\u4f18\u5316\u624b\u6bb5\u5728Mobile\u4fa7\u540c\u6837\u9002\u7528<br \/>\n2. \u5728Mobile\u4fa7\u6211\u4eec\u63d0\u51fa\u4e09\u79d2\u79cd\u6e32\u67d3\u5b8c\u6210\u9996\u5c4f\u6307\u6807<br \/>\n3. \u57fa\u4e8e\u7b2c\u4e8c\u70b9\uff0c\u9996\u5c4f\u52a0\u8f7d3\u79d2\u5b8c\u6210\u6216\u4f7f\u7528Loading<br \/>\n4. \u57fa\u4e8e\u8054\u901a3G\u7f51\u7edc\u5e73\u5747338KB\/s(2.71Mb\/s)\uff0c\u6240\u4ee5\u9996\u5c4f\u8d44\u6e90\u4e0d\u5e94\u8d85\u8fc71014KB<br \/>\n5. Mobile\u4fa7\u56e0\u624b\u673a\u914d\u7f6e\u539f\u56e0\uff0c\u9664\u52a0\u8f7d\u5916\u6e32\u67d3\u901f\u5ea6\u4e5f\u662f\u4f18\u5316\u91cd\u70b9<br \/>\n6. \u57fa\u4e8e\u7b2c\u4e94\u70b9\uff0c\u8981\u5408\u7406\u5904\u7406\u4ee3\u7801\u51cf\u5c11\u6e32\u67d3\u635f\u8017<br \/>\n7. \u57fa\u4e8e\u7b2c\u4e8c\u3001\u7b2c\u4e94\u70b9\uff0c\u6240\u6709\u5f71\u54cd\u9996\u5c4f\u52a0\u8f7d\u548c\u6e32\u67d3\u7684\u4ee3\u7801\u5e94\u5728\u5904\u7406\u903b\u8f91\u4e2d\u540e\u7f6e<br \/>\n8. \u52a0\u8f7d\u5b8c\u6210\u540e\u7528\u6237\u4ea4\u4e92\u4f7f\u7528\u65f6\u4e5f\u9700\u6ce8\u610f\u6027\u80fd<br \/>\n<a href=\"https:\/\/blog.lcsoul.top\/image\/20160707\/web-optimization-02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full\" src=\"https:\/\/blog.lcsoul.top\/image\/20160707\/web-optimization-02.png\" alt=\"web-optimization-02.png\" width=\"910\" height=\"772\" \/><\/a><\/p>\n<h2 style=\"text-align: center;\"><strong>\u4f18\u5316\u6307\u5357<\/strong><\/h2>\n<h3>[\u52a0\u8f7d\u4f18\u5316]<\/h3>\n<p>\u52a0\u8f7d\u8fc7\u7a0b\u662f\u6700\u4e3a\u8017\u65f6\u7684\u8fc7\u7a0b\uff0c\u53ef\u80fd\u4f1a\u5360\u5230\u603b\u8017\u65f6\u768480%\u65f6\u95f4\uff0c\u56e0\u6b64\u662f\u4f18\u5316\u7684\u91cd\u70b9<br \/>\n<strong>\u00b7 \u51cf\u5c11HTTP\u8bf7\u6c42<\/strong><br \/>\n\u56e0\u4e3a\u624b\u673a\u6d4f\u89c8\u5668\u540c\u65f6\u54cd\u5e94\u8bf7\u6c42\u4e3a4\u4e2a\u8bf7\u6c42\uff08Android\u652f\u63014\u4e2a\uff0ciOS 5\u540e\u53ef\u652f\u63016\u4e2a\uff09\uff0c\u6240\u4ee5\u8981\u5c3d\u91cf\u51cf\u5c11\u9875\u9762\u7684\u8bf7\u6c42\u6570\uff0c\u9996\u6b21\u52a0\u8f7d\u540c\u65f6\u8bf7\u6c42\u6570\u4e0d\u80fd\u8d85\u8fc74\u4e2a<br \/>\na) \u5408\u5e76CSS\u3001JavaScript<br \/>\nb) \u5408\u5e76\u5c0f\u56fe\u7247\uff0c\u4f7f\u7528\u96ea\u78a7\u56fe<br \/>\n<strong>\u00b7 \u7f13\u5b58<\/strong><br \/>\n\u4f7f\u7528\u7f13\u5b58\u53ef\u4ee5\u51cf\u5c11\u5411\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u6570\uff0c\u8282\u7701\u52a0\u8f7d\u65f6\u95f4\uff0c\u6240\u4ee5\u6240\u6709\u9759\u6001\u8d44\u6e90\u90fd\u8981\u5728\u670d\u52a1\u5668\u7aef\u8bbe\u7f6e\u7f13\u5b58\uff0c\u5e76\u4e14\u5c3d\u91cf\u4f7f\u7528\u957fCache\uff08\u957fCache\u8d44\u6e90\u7684\u66f4\u65b0\u53ef\u4f7f\u7528\u65f6\u95f4\u6233\uff09<br \/>\na) \u7f13\u5b58\u4e00\u5207\u53ef\u7f13\u5b58\u7684\u8d44\u6e90<br \/>\nb) \u4f7f\u7528\u957fCache\uff08\u4f7f\u7528\u65f6\u95f4\u6233\u66f4\u65b0Cache\uff09<br \/>\nc) \u4f7f\u7528\u5916\u8054\u5f0f\u5f15\u7528CSS\u3001JavaScript<br \/>\n<strong>\u00b7 \u538b\u7f29HTML\u3001CSS\u3001JavaScript<\/strong><br \/>\n\u51cf\u5c11\u8d44\u6e90\u5927\u5c0f\u53ef\u4ee5\u52a0\u5feb\u7f51\u9875\u663e\u793a\u901f\u5ea6\uff0c\u6240\u4ee5\u8981\u5bf9HTML\u3001CSS\u3001JavaScript\u7b49\u8fdb\u884c\u4ee3\u7801\u538b\u7f29\uff0c\u5e76\u5728\u670d\u52a1\u5668\u7aef\u8bbe\u7f6eGZip<br \/>\na) \u538b\u7f29\uff08\u4f8b\u5982\uff0c\u591a\u4f59\u7684\u7a7a\u683c\u3001\u6362\u884c\u7b26\u548c\u7f29\u8fdb\uff09<br \/>\nb) \u542f\u7528GZip<br \/>\n<strong>\u00b7 \u65e0\u963b\u585e<\/strong><br \/>\n\u5199\u5728HTML\u5934\u90e8\u7684JavaScript\uff08\u65e0\u5f02\u6b65\uff09\uff0c\u548c\u5199\u5728HTML\u6807\u7b7e\u4e2d\u7684Style\u4f1a\u963b\u585e\u9875\u9762\u7684\u6e32\u67d3\uff0c\u56e0\u6b64CSS\u653e\u5728\u9875\u9762\u5934\u90e8\u5e76\u4f7f\u7528Link\u65b9\u5f0f\u5f15\u5165\uff0c\u907f\u514d\u5728HTML\u6807\u7b7e\u4e2d\u5199Style\uff0cJavaScript\u653e\u5728\u9875\u9762\u5c3e<br \/>\n\u90e8\u6216\u4f7f\u7528\u5f02\u6b65\u65b9\u5f0f\u52a0\u8f7d<br \/>\n<strong>\u00b7\u00a0\u4f7f\u7528\u9996\u5c4f\u52a0\u8f7d<\/strong><br \/>\n\u9996\u5c4f\u7684\u5feb\u901f\u663e\u793a\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u5347\u7528\u6237\u5bf9\u9875\u9762\u901f\u5ea6\u7684\u611f\u77e5\uff0c\u56e0\u6b64\u5e94\u5c3d\u91cf\u9488\u5bf9\u9996\u5c4f\u7684\u5feb\u901f\u663e\u793a\u505a\u4f18\u5316<br \/>\n<strong>\u00b7 \u6309\u9700\u52a0\u8f7d<\/strong><br \/>\n\u5c06\u4e0d\u5f71\u54cd\u9996\u5c4f\u7684\u8d44\u6e90\u548c\u5f53\u524d\u5c4f\u5e55\u8d44\u6e90\u4e0d\u7528\u7684\u8d44\u6e90\u653e\u5230\u7528\u6237\u9700\u8981\u65f6\u624d\u52a0\u8f7d\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u5347\u91cd\u8981\u8d44\u6e90\u7684\u663e\u793a\u901f\u5ea6\u548c\u964d\u4f4e\u603b\u4f53\u6d41\u91cf<br \/>\nPS\uff1a\u6309\u9700\u52a0\u8f7d\u4f1a\u5bfc\u81f4\u5927\u91cf\u91cd\u7ed8\uff0c\u5f71\u54cd\u6e32\u67d3\u6027\u80fd<br \/>\na) LazyLoad<br \/>\nb) \u6eda\u5c4f\u52a0\u8f7d<br \/>\nc) \u901a\u8fc7Media Query\u52a0\u8f7d<br \/>\n<strong>\u00b7 \u9884\u52a0\u8f7d<\/strong><br \/>\n\u5927\u578b\u91cd\u8d44\u6e90\u9875\u9762\uff08\u5982\u6e38\u620f\uff09\u53ef\u4f7f\u7528\u589e\u52a0Loading\u7684\u65b9\u6cd5\uff0c\u8d44\u6e90\u52a0\u8f7d\u5b8c\u6210\u540e\u518d\u663e\u793a\u9875\u9762\u3002\u4f46Loading\u65f6\u95f4\u8fc7\u957f\uff0c\u4f1a\u9020\u6210\u7528\u6237\u6d41\u5931<br \/>\n\u5bf9\u7528\u6237\u884c\u4e3a\u5206\u6790\uff0c\u53ef\u4ee5\u5728\u5f53\u524d\u9875\u52a0\u8f7d\u4e0b\u4e00\u9875\u8d44\u6e90\uff0c\u63d0\u5347\u901f\u5ea6<br \/>\na) \u53ef\u611f\u77e5Loading(\u5982\u8fdb\u5165\u7a7a\u95f4\u6e38\u620f\u7684Loading)<br \/>\nb) \u4e0d\u53ef\u611f\u77e5\u7684Loading\uff08\u5982\u63d0\u524d\u52a0\u8f7d\u4e0b\u4e00\u9875\uff09<br \/>\n<strong>\u00b7 \u538b\u7f29\u56fe\u7247<\/strong><br \/>\n\u56fe\u7247\u662f\u6700\u5360\u6d41\u91cf\u7684\u8d44\u6e90\uff0c\u56e0\u6b64\u5c3d\u91cf\u907f\u514d\u4f7f\u7528\u4ed6\uff0c\u4f7f\u7528\u65f6\u9009\u62e9\u6700\u5408\u9002\u7684\u683c\u5f0f\uff08\u5b9e\u73b0\u9700\u6c42\u7684\u524d\u63d0\u4e0b\uff0c\u4ee5\u5927\u5c0f\u5224\u65ad\uff09\uff0c\u5408\u9002\u7684\u5927\u5c0f\uff0c\u7136\u540e\u4f7f\u7528\u667a\u56fe\u538b\u7f29\uff0c\u540c\u65f6\u5728\u4ee3\u7801\u4e2d\u7528Srcset\u6765\u6309\u9700\u663e\u793a<br \/>\nPS\uff1a\u8fc7\u5ea6\u538b\u7f29\u56fe\u7247\u5927\u5c0f\u5f71\u54cd\u56fe\u7247\u663e\u793a\u6548\u679c<br \/>\na) \u4f7f\u7528\u667a\u56fe\uff08\u00a0<a href=\"http:\/\/zhitu.isux.us\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/zhitu.isux.us\/<\/a>\u00a0\uff09<br \/>\nb) \u4f7f\u7528\u5176\u5b83\u65b9\u5f0f\u4ee3\u66ff\u56fe\u7247(1. \u4f7f\u7528CSS3\u00a02. \u4f7f\u7528SVG\u00a03. \u4f7f\u7528IconFont)<br \/>\nc) \u4f7f\u7528Srcset<br \/>\nd) \u9009\u62e9\u5408\u9002\u7684\u56fe\u7247(1. webP\u4f18\u4e8eJPG\u00a02. PNG8\u4f18\u4e8eGIF)<br \/>\ne) \u9009\u62e9\u5408\u9002\u7684\u5927\u5c0f\uff081. \u9996\u6b21\u52a0\u8f7d\u4e0d\u5927\u4e8e1014KB\u00a02. \u4e0d\u5bbd\u4e8e640\uff08\u57fa\u4e8e\u624b\u673a\u5c4f\u5e55\u4e00\u822c\u5bbd\u5ea6\uff09\uff09<br \/>\n<strong>\u00b7 \u51cf\u5c11Cookie<\/strong><br \/>\nCookie\u4f1a\u5f71\u54cd\u52a0\u8f7d\u901f\u5ea6\uff0c\u6240\u4ee5\u9759\u6001\u8d44\u6e90\u57df\u540d\u4e0d\u4f7f\u7528Cookie<br \/>\n<strong>\u00b7 \u907f\u514d\u91cd\u5b9a\u5411<\/strong><br \/>\n\u91cd\u5b9a\u5411\u4f1a\u5f71\u54cd\u52a0\u8f7d\u901f\u5ea6\uff0c\u6240\u4ee5\u5728\u670d\u52a1\u5668\u6b63\u786e\u8bbe\u7f6e\u907f\u514d\u91cd\u5b9a\u5411<br \/>\n<strong>\u00b7 \u5f02\u6b65\u52a0\u8f7d\u7b2c\u4e09\u65b9\u8d44\u6e90<\/strong><br \/>\n\u7b2c\u4e09\u65b9\u8d44\u6e90\u4e0d\u53ef\u63a7\u4f1a\u5f71\u54cd\u9875\u9762\u7684\u52a0\u8f7d\u548c\u663e\u793a\uff0c\u56e0\u6b64\u8981\u5f02\u6b65\u52a0\u8f7d\u7b2c\u4e09\u65b9\u8d44\u6e90<\/p>\n<h3>[\u811a\u672c\u6267\u884c\u4f18\u5316]<\/h3>\n<p>\u811a\u672c\u5904\u7406\u4e0d\u5f53\u4f1a\u963b\u585e\u9875\u9762\u52a0\u8f7d\u3001\u6e32\u67d3\uff0c\u56e0\u6b64\u5728\u4f7f\u7528\u65f6\u9700\u5f53\u6ce8\u610f<br \/>\n<strong>\u00b7 CSS\u5199\u5728\u5934\u90e8\uff0cJavaScript\u5199\u5728\u5c3e\u90e8\u6216\u5f02\u6b65<\/strong><br \/>\n<strong>\u00b7 \u907f\u514d\u56fe\u7247\u548ciFrame\u7b49\u7684\u7a7aSrc<\/strong><br \/>\n\u7a7aSrc\u4f1a\u91cd\u65b0\u52a0\u8f7d\u5f53\u524d\u9875\u9762\uff0c\u5f71\u54cd\u901f\u5ea6\u548c\u6548\u7387<br \/>\n\u00b7 \u5c3d\u91cf\u907f\u514d\u91cd\u8bbe\u56fe\u7247\u5927\u5c0f<br \/>\n\u91cd\u8bbe\u56fe\u7247\u5927\u5c0f\u662f\u6307\u5728\u9875\u9762\u3001CSS\u3001JavaScript\u7b49\u4e2d\u591a\u6b21\u91cd\u7f6e\u56fe\u7247\u5927\u5c0f\uff0c\u591a\u6b21\u91cd\u8bbe\u56fe\u7247\u5927\u5c0f\u4f1a\u5f15\u53d1\u56fe\u7247\u7684\u591a\u6b21\u91cd\u7ed8\uff0c\u5f71\u54cd\u6027\u80fd<br \/>\n<strong>\u00b7\u00a0\u56fe\u7247\u5c3d\u91cf\u907f\u514d\u4f7f\u7528DataURL<\/strong><br \/>\nDataURL\u56fe\u7247\u6ca1\u6709\u4f7f\u7528\u56fe\u7247\u7684\u538b\u7f29\u7b97\u6cd5\u6587\u4ef6\u4f1a\u53d8\u5927\uff0c\u5e76\u4e14\u8981\u89e3\u7801\u540e\u518d\u6e32\u67d3\uff0c\u52a0\u8f7d\u6162\u8017\u65f6\u957f<\/p>\n<h3>[CSS\u4f18\u5316]<\/h3>\n<p>\u00b7 \u5c3d\u91cf\u907f\u514d\u5199\u5728HTML\u6807\u7b7e\u4e2d\u5199Style\u5c5e\u6027<br \/>\n<strong>\u00b7 \u907f\u514dCSS\u8868\u8fbe\u5f0f<\/strong><br \/>\nCSS\u8868\u8fbe\u5f0f\u7684\u6267\u884c\u9700\u8df3\u51faCSS\u6811\u7684\u6e32\u67d3\uff0c\u56e0\u6b64\u8bf7\u907f\u514dCSS\u8868\u8fbe\u5f0f<br \/>\n\u00b7 \u79fb\u9664\u7a7a\u7684CSS\u89c4\u5219<br \/>\n\u7a7a\u7684CSS\u89c4\u5219\u589e\u52a0\u4e86CSS\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u4e14\u5f71\u54cdCSS\u6811\u7684\u6267\u884c\uff0c\u6240\u4ee5\u9700\u79fb\u9664\u7a7a\u7684CSS\u89c4\u5219<br \/>\n\u00b7 \u6b63\u786e\u4f7f\u7528Display\u7684\u5c5e\u6027<br \/>\nDisplay\u5c5e\u6027\u4f1a\u5f71\u54cd\u9875\u9762\u7684\u6e32\u67d3\uff0c\u56e0\u6b64\u8bf7\u5408\u7406\u4f7f\u7528<br \/>\na) display:inline\u540e\u4e0d\u5e94\u8be5\u518d\u4f7f\u7528width\u3001height\u3001margin\u3001padding\u4ee5\u53cafloat<br \/>\nb) display:inline-block\u540e\u4e0d\u5e94\u8be5\u518d\u4f7f\u7528float<br \/>\nc) display:block\u540e\u4e0d\u5e94\u8be5\u518d\u4f7f\u7528vertical-align<br \/>\nd) display:table-*\u540e\u4e0d\u5e94\u8be5\u518d\u4f7f\u7528margin\u6216\u8005float<br \/>\n\u00b7 \u4e0d\u6ee5\u7528Float<br \/>\nFloat\u5728\u6e32\u67d3\u65f6\u8ba1\u7b97\u91cf\u6bd4\u8f83\u5927\uff0c\u5c3d\u91cf\u51cf\u5c11\u4f7f\u7528<br \/>\n\u00b7 \u4e0d\u6ee5\u7528Web\u5b57\u4f53<br \/>\nWeb\u5b57\u4f53\u9700\u8981\u4e0b\u8f7d\uff0c\u89e3\u6790\uff0c\u91cd\u7ed8\u5f53\u524d\u9875\u9762\uff0c\u5c3d\u91cf\u51cf\u5c11\u4f7f\u7528<br \/>\n\u00b7 \u4e0d\u58f0\u660e\u8fc7\u591a\u7684Font-size<br \/>\n\u8fc7\u591a\u7684Font-size\u5f15\u53d1CSS\u6811\u7684\u6548\u7387<br \/>\n\u00b7 \u503c\u4e3a0\u65f6\u4e0d\u9700\u8981\u4efb\u4f55\u5355\u4f4d<br \/>\n\u4e3a\u4e86\u6d4f\u89c8\u5668\u7684\u517c\u5bb9\u6027\u548c\u6027\u80fd\uff0c\u503c\u4e3a0\u65f6\u4e0d\u8981\u5e26\u5355\u4f4d<br \/>\n\u00b7 \u6807\u51c6\u5316\u5404\u79cd\u6d4f\u89c8\u5668\u524d\u7f00<br \/>\na) \u65e0\u524d\u7f00\u5e94\u653e\u5728\u6700\u540e<br \/>\nb) CSS\u52a8\u753b\u53ea\u7528 \uff08-webkit- \u65e0\u524d\u7f00\uff09\u4e24\u79cd\u5373\u53ef<br \/>\nc) \u5176\u5b83\u524d\u7f00\u4e3a -webkit- -moz- -ms- \u65e0\u524d\u7f00 \u56db\u79cd\uff0c\uff08-o-Opera\u6d4f\u89c8\u5668\u6539\u7528blink\u5185\u6838\uff0c\u6240\u4ee5\u6dd8\u6c70\uff09<br \/>\n\u00b7 \u907f\u514d\u8ba9\u9009\u62e9\u7b26\u770b\u8d77\u6765\u50cf\u6b63\u5219\u8868\u8fbe\u5f0f<br \/>\n\u9ad8\u7ea7\u9009\u62e9\u5668\u6267\u884c\u8017\u65f6\u957f\u4e14\u4e0d\u6613\u8bfb\u61c2\uff0c\u907f\u514d\u4f7f\u7528<\/p>\n<h3>[JavaScript\u6267\u884c\u4f18\u5316]<\/h3>\n<p>\u00b7 \u51cf\u5c11\u91cd\u7ed8\u548c\u56de\u6d41<br \/>\na) \u907f\u514d\u4e0d\u5fc5\u8981\u7684Dom\u64cd\u4f5c<br \/>\nb) \u5c3d\u91cf\u6539\u53d8Class\u800c\u4e0d\u662fStyle\uff0c\u4f7f\u7528classList\u4ee3\u66ffclassName<br \/>\nc) \u907f\u514d\u4f7f\u7528document.write<br \/>\nd) \u51cf\u5c11drawImage<br \/>\n\u00b7\u00a0\u7f13\u5b58Dom\u9009\u62e9\u4e0e\u8ba1\u7b97<br \/>\n\u6bcf\u6b21Dom\u9009\u62e9\u90fd\u8981\u8ba1\u7b97\uff0c\u7f13\u5b58\u4ed6<br \/>\n\u00b7 \u7f13\u5b58\u5217\u8868.length<br \/>\n\u6bcf\u6b21.length\u90fd\u8981\u8ba1\u7b97\uff0c\u7528\u4e00\u4e2a\u53d8\u91cf\u4fdd\u5b58\u8fd9\u4e2a\u503c<br \/>\n\u00b7 \u5c3d\u91cf\u4f7f\u7528\u4e8b\u4ef6\u4ee3\u7406\uff0c\u907f\u514d\u6279\u91cf\u7ed1\u5b9a\u4e8b\u4ef6<br \/>\n\u00b7 \u5c3d\u91cf\u4f7f\u7528ID\u9009\u62e9\u5668<br \/>\nID\u9009\u62e9\u5668\u662f\u6700\u5feb\u7684<br \/>\n\u00b7 TOUCH\u4e8b\u4ef6\u4f18\u5316<br \/>\n\u4f7f\u7528touchstart\u3001touchend\u4ee3\u66ffclick\uff0c\u56e0\u5feb\u5f71\u54cd\u901f\u5ea6\u5feb\u3002\u4f46\u5e94\u6ce8\u610fTouch\u54cd\u5e94\u8fc7\u5feb\uff0c\u6613\u5f15\u53d1\u8bef\u64cd\u4f5c<\/p>\n<h3>[\u6e32\u67d3\u4f18\u5316]<\/h3>\n<p>\u00b7\u00a0HTML\u4f7f\u7528Viewport<br \/>\nViewport\u53ef\u4ee5\u52a0\u901f\u9875\u9762\u7684\u6e32\u67d3\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801<br \/>\n<em>&lt;meta name=\u201dviewport\u201d content=\u201dwidth=device-width, initial-scale=1\u2033&gt;<\/em><br \/>\n\u00b7 \u51cf\u5c11Dom\u8282\u70b9<br \/>\nDom\u8282\u70b9\u592a\u591a\u5f71\u54cd\u9875\u9762\u7684\u6e32\u67d3\uff0c\u5e94\u5c3d\u91cf\u51cf\u5c11Dom\u8282\u70b9<br \/>\n\u00b7 \u52a8\u753b\u4f18\u5316<br \/>\na) \u5c3d\u91cf\u4f7f\u7528CSS3\u52a8\u753b<br \/>\nb) \u5408\u7406\u4f7f\u7528requestAnimationFrame\u52a8\u753b\u4ee3\u66ffsetTimeout<br \/>\nc) \u9002\u5f53\u4f7f\u7528Canvas\u52a8\u753b\u00a05\u4e2a\u5143\u7d20\u4ee5\u5185\u4f7f\u7528css\u52a8\u753b\uff0c5\u4e2a\u4ee5\u4e0a\u4f7f\u7528Canvas\u52a8\u753b\uff08iOS8\u53ef\u4f7f\u7528webGL\uff09<br \/>\n\u00b7 \u9ad8\u9891\u4e8b\u4ef6\u4f18\u5316<br \/>\nTouchmove\u3001Scroll \u4e8b\u4ef6\u53ef\u5bfc\u81f4\u591a\u6b21\u6e32\u67d3<br \/>\na) \u4f7f\u7528requestAnimationFrame\u76d1\u542c\u5e27\u53d8\u5316\uff0c\u4f7f\u5f97\u5728\u6b63\u786e\u7684\u65f6\u95f4\u8fdb\u884c\u6e32\u67d3<br \/>\nb) \u589e\u52a0\u54cd\u5e94\u53d8\u5316\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u51cf\u5c11\u91cd\u7ed8\u6b21\u6570<\/p>\n<div>\u00b7 GPU\u52a0\u901f<br \/>\nCSS\u4e2d\u4ee5\u4e0b\u5c5e\u6027\uff08CSS3 transitions\u3001CSS3 3D transforms\u3001Opacity\u3001Canvas\u3001WebGL\u3001Video\uff09\u6765\u89e6\u53d1GPU\u6e32\u67d3\uff0c\u8bf7\u5408\u7406\u4f7f\u7528<\/p>\n<div>PS\uff1a\u8fc7\u6e21\u4f7f\u7528\u4f1a\u5f15\u53d1\u624b\u673a\u8fc7\u8017\u7535\u589e\u52a0<\/div>\n<\/div>\n<div><\/div>\n<div>\u672c\u6587\u8f6c\u81ea\uff1a<a href=\"https:\/\/isux.tencent.com\/h5-performance.html\">https:\/\/isux.tencent.com\/h5-performance.html<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[33,50,128,133,185,205],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-share","tag-css","tag-javascript","tag-128","tag-133","tag-185","tag-205"],"_links":{"self":[{"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":0,"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lcsoul.top\/index.php\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}