{"id":4010,"date":"2024-11-10T14:54:20","date_gmt":"2024-11-10T06:54:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/4010\/"},"modified":"2024-11-10T14:54:20","modified_gmt":"2024-11-10T06:54:20","slug":"%e8%bd%ae%e6%92%ad%e6%9c%80%e5%90%8e%e4%b8%80%e9%a1%b5%e5%88%87%e6%8d%a2%e5%88%b0%e7%ac%ac%e4%b8%80%e9%a1%b5%e6%97%b6%e9%97%aa%e5%8a%a8%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/4010\/","title":{"rendered":"\u8f6e\u64ad\u6700\u540e\u4e00\u9875\u5207\u6362\u5230\u7b2c\u4e00\u9875\u65f6\u95ea\u52a8\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173121140631816.jpg\" class=\"aligncenter\" title=\"\u8f6e\u64ad\u6700\u540e\u4e00\u9875\u5207\u6362\u5230\u7b2c\u4e00\u9875\u65f6\u95ea\u52a8\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"\u8f6e\u64ad\u6700\u540e\u4e00\u9875\u5207\u6362\u5230\u7b2c\u4e00\u9875\u65f6\u95ea\u52a8\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u8f6e\u64ad\u56de\u9000\u65f6\u95ea\u52a8\u7684\u89e3\u51b3\u529e\u6cd5<\/strong><\/p>\n<p>\u5728\u8f6e\u64ad\u56fe\u4e2d\uff0c\u4f7f\u7528translate3d\u6765\u79fb\u52a8\u9875\u9762\u65f6\uff0c\u5728\u6700\u540e\u4e00\u9875\u5207\u6362\u5230\u7b2c\u4e00\u9875\u9762\u65f6\uff0c\u4f1a\u53d1\u751f\u95ea\u52a8\u3002\u8fd9\u662f\u56e0\u4e3a\u5728\u6700\u540e\u4e00\u9875\u5207\u6362\u4e0b\u4e00\u5f20\u65f6\uff0c\u4f7f\u7528\u4e86\u8fc7\u6e21\u52a8\u753b\uff0c\u800c\u5728\u7b2c\u4e00\u9875\u5207\u6362\u4e0a\u4e00\u5f20\u65f6\u6ca1\u6709\u4f7f\u7528\u3002<\/p>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u9700\u8981\u786e\u4fdd\u5728\u6240\u6709\u5207\u6362\u64cd\u4f5c\u4e2d\u90fd\u4f7f\u7528\u8fc7\u6e21\u52a8\u753b\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4fee\u6539changecur\u65b9\u6cd5\u4ee5\u4fee\u590d\u8be5\u95ee\u9898\u7684\u793a\u4f8b\uff1a<\/p>\n<pre>changeCur(add){\n                \/\/ this.out.style.setProperty('--trans', 'transform');\n                this.con.style.transitionDuration = '.3s';\n\n                \/\/\u5207\u6362cur\u65b9\u6cd5\n                let cur = this.out.style.getPropertyValue('--cur');\n                cur = parseInt(cur);\n\n                if(add){\n                    \/\/ this.setCur(cur+1);\n\n                    \/\/ if(cur &gt; this.num-1){\n                    \/\/     setTimeout(() =&gt; {\n                    \/\/         \/\/ cur = 1;\n                    \/\/         \/\/ this.out.style.setProperty('--trans', 'none');\n                    \/\/         this.con.style.transitionDuration = '0s';\n                    \/\/         this.setCur(1);\n                    \/\/     }, 300)\n                    \/\/ }\n                   if (cur === this.num) {\n                        this.con.style.transitionDuration = '0s';\n                        this.setCur(0);\n                        this.con.offsetWidth;\n                        this.con.style.transitionDuration = '.3s';\n                        this.setCur(1);\n\n                    } else {\n                        this.setCur(cur + 1);\n                    }\n\n                }\n                else{\n                    \/\/ this.setCur(cur-1);\n                    \/\/ if(cur &lt; 2){\n                    \/\/     \/\/ setTimeout(() =&gt; {\n                    \/\/     \/\/     \/\/ cur = this.num;\n                    \/\/     \/\/     \/\/ this.out.style.setProperty('--trans', 'none');\n                    \/\/     \/\/     this.con.style.transitionDuration = '0s';\n                    \/\/     \/\/     this.setCur(this.num);\n                    \/\/     \/\/ }, 300)\n                    \/\/ }\n                    if (cur === 1) {\n                        this.con.style.transitionDuration = '0s';\n                        this.setCur(this.num + 1);\n                        this.con.offsetWidth;\n                        this.con.style.transitionDuration = '.3s';\n                        this.setCur(this.num);\n                    } else {\n                        this.setCur(cur - 1);\n                    }\n\n                }\n            }<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8f6e\u64ad\u6700\u540e\u4e00\u9875\u5207\u6362\u5230\u7b2c\u4e00\u9875\u65f6\u95ea\u52a8\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6e\u64ad\u56de\u9000\u65f6\u95ea\u52a8\u7684\u89e3\u51b3\u529e\u6cd5 \u5728\u8f6e\u64ad\u56fe\u4e2d\uff0c\u4f7f\u7528translate3d\u6765\u79fb\u52a8\u9875\u9762\u65f6\uff0c\u5728\u6700\u540e\u4e00\u9875\u5207\u6362\u5230\u7b2c\u4e00\u9875\u9762\u65f6\uff0c\u4f1a\u53d1\u751f\u95ea\u52a8\u3002\u8fd9\u662f\u56e0\u4e3a\u5728\u6700\u540e\u4e00\u9875\u5207\u6362\u4e0b\u4e00\u5f20\u65f6\uff0c\u4f7f\u7528\u4e86\u8fc7\u6e21\u52a8\u753b\uff0c\u800c\u5728\u7b2c\u4e00\u9875\u5207\u6362\u4e0a\u4e00\u5f20\u65f6\u6ca1\u6709\u4f7f\u7528\u3002 \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u9700\u8981\u786e\u4fdd\u5728\u6240\u6709\u5207\u6362\u64cd\u4f5c\u4e2d\u90fd\u4f7f\u7528\u8fc7\u6e21\u52a8\u753b\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4fee\u6539changecur\u65b9\u6cd5\u4ee5\u4fee\u590d\u8be5\u95ee\u9898\u7684\u793a\u4f8b\uff1a changeCur(add){ \/\/ this.out.style.setProperty(&#8216;&#8211;trans&#8217;, &#8216;transform&#8217;); this.con.style.transitionDuration = &#8216;.3s&#8217;; \/\/\u5207\u6362cur\u65b9\u6cd5 let cur = this.out.style.getPropertyValue(&#8216;&#8211;cur&#8217;); cur = parseInt(cur); if(add){ \/\/ this.setCur(cur+1); \/\/ if(cur &gt; this.num-1){ \/\/ setTimeout(() =&gt; { \/\/ \/\/ cur = 1; \/\/ \/\/ this.out.style.setProperty(&#8216;&#8211;trans&#8217;, &#8216;none&#8217;); \/\/ this.con.style.transitionDuration = &#8216;0s&#8217;; \/\/ this.setCur(1); \/\/ }, 300) \/\/ } if (cur === this.num) { this.con.style.transitionDuration [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-4010","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/4010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=4010"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/4010\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=4010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=4010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=4010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}