{"id":28197,"date":"2024-11-24T11:25:19","date_gmt":"2024-11-24T03:25:19","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28197\/"},"modified":"2024-11-24T11:25:19","modified_gmt":"2024-11-24T03:25:19","slug":"%e8%bd%ae%e6%92%ad%e5%9b%be%e6%9c%80%e5%90%8e%e4%b8%80%e9%a1%b5%e5%88%87%e6%8d%a2%e5%9b%9e%e7%ac%ac%e4%b8%80%e9%a1%b5%e6%97%b6%e5%87%ba%e7%8e%b0%e9%97%aa%e5%8a%a8%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28197\/","title":{"rendered":"\u8f6e\u64ad\u56fe\u6700\u540e\u4e00\u9875\u5207\u6362\u56de\u7b2c\u4e00\u9875\u65f6\u51fa\u73b0\u95ea\u52a8\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173145674226839.jpg\" class=\"aligncenter\" title=\"\u8f6e\u64ad\u56fe\u6700\u540e\u4e00\u9875\u5207\u6362\u56de\u7b2c\u4e00\u9875\u65f6\u51fa\u73b0\u95ea\u52a8\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"\u8f6e\u64ad\u56fe\u6700\u540e\u4e00\u9875\u5207\u6362\u56de\u7b2c\u4e00\u9875\u65f6\u51fa\u73b0\u95ea\u52a8\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u8f6e\u64ad\u5faa\u73af\u5207\u6362\u95ea\u52a8\u539f\u56e0\u53ca\u89e3\u51b3<\/strong><\/p>\n<p>\u8f6e\u64ad\u56fe\u6700\u540e\u4e00\u9875\u5207\u6362\u56de\u7b2c\u4e00\u9875\u65f6\u51fa\u73b0\u95ea\u52a8\uff0c\u539f\u56e0\u5982\u4e0b\uff1a<\/p>\n<p>\u5f53\u4f7f\u7528 translate3d \u65b9\u5f0f\u5207\u6362\u65f6\uff0cCSS \u6837\u5f0f\u6ca1\u6709\u53ca\u65f6\u66f4\u65b0\u3002\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5\u662f\u4fee\u6539 changeCur \u65b9\u6cd5\uff1a<\/p>\n<pre>changeCur(add) {\n  this.con.style.transitionDuration = '.3s';\n\n  let cur = parseInt(this.out.style.getPropertyValue('--cur'));\n\n  if (add) {\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    } else {\n      this.setCur(cur + 1);\n    }\n  } else {\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}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8f6e\u64ad\u56fe\u6700\u540e\u4e00\u9875\u5207\u6362\u56de\u7b2c\u4e00\u9875\u65f6\u51fa\u73b0\u95ea\u52a8\uff0c\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\u5faa\u73af\u5207\u6362\u95ea\u52a8\u539f\u56e0\u53ca\u89e3\u51b3 \u8f6e\u64ad\u56fe\u6700\u540e\u4e00\u9875\u5207\u6362\u56de\u7b2c\u4e00\u9875\u65f6\u51fa\u73b0\u95ea\u52a8\uff0c\u539f\u56e0\u5982\u4e0b\uff1a \u5f53\u4f7f\u7528 translate3d \u65b9\u5f0f\u5207\u6362\u65f6\uff0cCSS \u6837\u5f0f\u6ca1\u6709\u53ca\u65f6\u66f4\u65b0\u3002\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5\u662f\u4fee\u6539 changeCur \u65b9\u6cd5\uff1a changeCur(add) { this.con.style.transitionDuration = &#8216;.3s&#8217;; let cur = parseInt(this.out.style.getPropertyValue(&#8216;&#8211;cur&#8217;)); if (add) { if (cur === this.num) { this.con.style.transitionDuration = &#8216;0s&#8217;; this.setCur(0); this.con.offsetWidth; this.con.style.transitionDuration = &#8216;.3s&#8217;; this.setCur(1); } else { this.setCur(cur + 1); } } else { if (cur === 1) { this.con.style.transitionDuration = &#8216;0s&#8217;; this.setCur(this.num + 1); [&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-28197","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28197","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=28197"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28197\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}