<\/span><\/h2>\n\n\n\n\u5982\u679c\u6211\u4eec\u628a\u76d1\u542c\u5668\u7684\u76d1\u542c\u65b9\u5f0f\u6539\u4e3a\u88ab\u52a8\u7684\uff0c\u5c31\u53ef\u4ee5\u6d88\u9664\u6389\u8fd9\u4e2a\u5ef6\u65f6\uff0c\u63d0\u9ad8\u7f51\u9875\u7684\u89e6\u6478\u548c\u6eda\u52a8\u6027\u80fd\u3002\u867d\u7136\u8fd9\u4e2a\u8b66\u544a\u4e0d\u4f1a\u76f4\u63a5\u5f71\u54cdPageSpeed Insights\u7684\u8bc4\u5206\uff0c\u89e3\u51b3\u6389\u8fd9\u4e2a\u5ef6\u65f6\u540e\uff0c\u5bf9\u63d0\u9ad8\u7f51\u9875\u7684\u7528\u6237\u4f53\u9a8c\u8fd8\u662f\u6709\u4e00\u4e9b\u5e2e\u52a9\u7684\u3002<\/p>\n\n\n\n
\u622a\u6b62\u672c\u6587\u53d1\u5e03\u4e4b\u65e5\uff0cWordPress\u5185\u7f6e\u7684jQuery\u5c1a\u4e0d\u652f\u6301\u8fd9\u4e2a\u64cd\u4f5c\u3002\u5f88\u5e78\u8fd0\u7684\u662f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e00\u6bb5\u7b80\u5355\u7684\u4ee3\u7801\u6765\u4e3ajQuery\u52a0\u4e0a\u8fd9\u4e2a\u652f\u6301\u3002<\/p>\n\n\n\n
add_action('wp_enqueue_scripts', function ()\r\n{\r\n wp_add_inline_script('jquery', '\r\n jQuery.event.special.touchstart = {\r\n setup: function( _, ns, handle ) {\r\n this.addEventListener(\"touchstart\", handle, { passive: !ns.includes(\"noPreventDefault\") });\r\n }\r\n };\r\n jQuery.event.special.touchmove = {\r\n setup: function( _, ns, handle ) {\r\n this.addEventListener(\"touchmove\", handle, { passive: !ns.includes(\"noPreventDefault\") });\r\n }\r\n };\r\n jQuery.event.special.wheel = {\r\n setup: function( _, ns, handle ){\r\n this.addEventListener(\"wheel\", handle, { passive: true });\r\n }\r\n };\r\n jQuery.event.special.mousewheel = {\r\n setup: function( _, ns, handle ){\r\n this.addEventListener(\"mousewheel\", handle, { passive: true });\r\n }\r\n };'\r\n );\r\n}, 999);<\/code><\/pre>\n\n\n\n\u5982\u679c\u60a8\u7684\u7f51\u7ad9\u4e2d\u6ca1\u6709\u4f7f\u7528jQuery\uff0c\u4f9d\u7136\u51fa\u73b0\u4e86\u672a\u4f7f\u7528\u88ab\u52a8\u5f0f\u76d1\u542c\u5668\u6765\u63d0\u9ad8\u6eda\u52a8\u6027\u80fd\u7684\u8b66\u544a\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0a\u4ee3\u7801\u4e2d\u7684this.addEventListener<\/code> \u90e8\u5206\u4fee\u6539\u60a8\u7684\u4ee3\u7801\uff0c\u6765\u5b9e\u73b0\u88ab\u52a8\u5f0f\u76d1\u542c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728\u4f7f\u7528 PageSpeed Insights \u6d4b\u8bd5\u6211\u4eec\u7684WordPress\u7ad9\u70b9\u7684\u4f7f\u7528\uff0c\u5982\u679c\u524d\u7aef\u52a0\u8f7d\u4e86jQuer […]<\/p>\n","protected":false},"author":1,"featured_media":43051,"comment_status":"open","ping_status":"closed","sticky":false,"template":"single-with-sidebar","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[98,48,429,33,333],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/posts\/49696"}],"collection":[{"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/comments?post=49696"}],"version-history":[{"count":1,"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/posts\/49696\/revisions"}],"predecessor-version":[{"id":50697,"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/posts\/49696\/revisions\/50697"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/media\/43051"}],"wp:attachment":[{"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/media?parent=49696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/categories?post=49696"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xyryd.com\/wp-json\/wp\/v2\/tags?post=49696"}],"curies":[{"name":"wp","href":"http:\/\/api.w.org\/{rel}","templated":true}]}}