{"id":7966,"date":"2025-06-09T13:51:27","date_gmt":"2025-06-09T04:51:27","guid":{"rendered":"https:\/\/code-plus.jp\/gp\/?p=7966"},"modified":"2025-06-09T13:51:27","modified_gmt":"2025-06-09T04:51:27","slug":"post-7966","status":"publish","type":"post","link":"https:\/\/code-plus.jp\/gp\/post-7966\/","title":{"rendered":"\u3010JS\u3011\u30af\u30ea\u30c3\u30af\u6642\u3068\u30db\u30d0\u30fc\u6642\u306b\u305d\u308c\u305e\u308c\u5bfe\u5fdc\u3059\u308bJavaScript\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3"},"content":{"rendered":"<p>Web\u30b5\u30a4\u30c8\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u6a5f\u80fd\u3002\u4eca\u56de\u306f\u3001<b class=\"fw-600\">\u30af\u30ea\u30c3\u30af\u6642\u3068\u30db\u30d0\u30fc\u6642\u306e\u4e21\u65b9\u306b\u5bfe\u5fdc<\/b>\u3057\u3001\u304b\u3064<b class=\"fw-600\">details\u30bf\u30b0\u3067\u3082WordPress\u30e1\u30cb\u30e5\u30fc\u3067\u3082\u4f7f\u3048\u308b<\/b>\u6c4e\u7528\u6027\u306e\u9ad8\u3044\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u3092\u76ee\u6307\u3057\u307e\u3057\u305f\u306b<b class=\"fw-600\">\u30db\u30d0\u30fc\u578b\u3067\u306f\u7d20\u65e9\u3044\u30de\u30a6\u30b9\u64cd\u4f5c\u306b\u3082\u5bfe\u5fdc<\/b>\u3057\u307e\u3059\u3002<\/p>\n<h2 class=\"fz-xl\">\u5b8c\u6210\u30c7\u30e2<\/h2>\n<iframe height=\"300\" style=\"width:100%;\" scrolling=\"no\" title=\"\u3010JS\u3011clickdion.js, hoverdion.js\uff08\u30af\u30ea\u30c3\u30af\u6642\u3068\u30db\u30d0\u30fc\u6642\u306e\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\uff09\" src=\"https:\/\/codepen.io\/sarap422\/embed\/YPXXJVO?theme-id=25176&amp;default-tab=result&amp;editable=true\" frameborder=\"no\" loading=\"lazy\" allowtransparency=\"true\" allowfullscreen=\"true\">See the Pen <a href='https:\/\/codepen.io\/sarap422\/pen\/YPXXJVO'>\u3010JS\u3011clickdion.js, hoverdion.js\uff08\u30af\u30ea\u30c3\u30af\u6642\u3068\u30db\u30d0\u30fc\u6642\u306e\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\uff09<\/a> by sarap422 (<a href='https:\/\/codepen.io\/sarap422'>@sarap422<\/a>)on <a href='https:\/\/codepen.io'>CodePen<\/a>.<\/iframe>\n\n\n<h3 class=\"fz-lg\">Clickdion\uff08\u30af\u30ea\u30c3\u30af\u578b\uff09<\/h3>\n<ul style=\"list-style-type:bullet;\">\n  <li><code>.opener<\/code>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3067\u958b\u9589<\/li>\n  <li>\u9023\u6253\u9632\u6b62\u6a5f\u80fd\u4ed8\u304d<\/li>\n  <li>summary\u3068button\u4e21\u65b9\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u5bfe\u5fdc<\/li>\n<\/ul>\n<h3 class=\"fz-lg\">Hoverdion\uff08\u30db\u30d0\u30fc\u578b\uff09<\/h3>\n<ul style=\"list-style-type:bullet;\">\n  <li>\u30de\u30a6\u30b9\u30db\u30d0\u30fc\u3067\u81ea\u52d5\u958b\u9589<\/li>\n  <li>\u7d20\u65e9\u3044\u30de\u30a6\u30b9\u79fb\u52d5\u306b\u3082\u5373\u5ea7\u306b\u53cd\u5fdc<\/li>\n  <li>\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u4e2d\u65ad\u6a5f\u80fd\u3067\u5feb\u9069\u306a\u64cd\u4f5c\u611f<\/li>\n<\/ul>\n<h2 class=\"fz-xl\">\u4e3b\u306a\u7279\u5fb4<\/h2>\n<h3 class=\"fz-lg\">1. details\u30bf\u30b0\u3067\u30b9\u30e0\u30fc\u30ba\u306a\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3<\/h3>\n<p>\u901a\u5e38\u3001<code>&lt;details&gt;<\/code>\u30bf\u30b0\u306f\u958b\u9589\u6642\u306b\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u304c\u9069\u7528\u3055\u308c\u307e\u305b\u3093\u304c\u3001Web Animations API\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u6ed1\u3089\u304b\u306a\u52d5\u4f5c\u3092\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-html\">&lt;div class=&quot;clickdion&quot;&gt;\n  &lt;details class=&quot;dion-item&quot;&gt;\n    &lt;summary class=&quot;dion-summary&quot;&gt;\n      \u30af\u30ea\u30c3\u30af\u3057\u3066\u958b\u9589&lt;button class=&quot;opener&quot;&gt;&lt;\/button&gt;\n    &lt;\/summary&gt;\n    &lt;div class=&quot;dion-content&quot;&gt;\n      &lt;!-- \u30b3\u30f3\u30c6\u30f3\u30c4 --&gt;\n    &lt;\/div&gt;\n  &lt;\/details&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3 class=\"fz-lg\">2. WordPress\u30e1\u30cb\u30e5\u30fc\u306b\u3082\u5bfe\u5fdc<\/h3>\n<p>WordPress\u306e\u6a19\u6e96\u7684\u306a\u30e1\u30cb\u30e5\u30fc\u69cb\u9020\u306b\u3082\u5bfe\u5fdc\u3002\u65e2\u5b58\u306e\u30c6\u30fc\u30de\u3092\u5927\u304d\u304f\u5909\u66f4\u3059\u308b\u3053\u3068\u306a\u304f\u5c0e\u5165\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-html\">&lt;ul class=&quot;hoverdion&quot;&gt;\n  &lt;li class=&quot;menu-item menu-item-has-children&quot;&gt;\n    &lt;a href=&quot;#&quot; class=&quot;menu-link&quot;&gt;\n      \u89aa\u30e1\u30cb\u30e5\u30fc&lt;button class=&quot;opener&quot;&gt;&lt;\/button&gt;\n    &lt;\/a&gt;\n    &lt;ul class=&quot;sub-menu&quot;&gt;\n      &lt;li class=&quot;menu-item&quot;&gt;\n        &lt;a href=&quot;#&quot; class=&quot;menu-link&quot;&gt;\u5b50\u30e1\u30cb\u30e5\u30fc1&lt;\/a&gt;\n      &lt;\/li&gt;\n      &lt;li class=&quot;menu-item&quot;&gt;\n        &lt;a href=&quot;#&quot; class=&quot;menu-link&quot;&gt;\u5b50\u30e1\u30cb\u30e5\u30fc2&lt;\/a&gt;\n      &lt;\/li&gt;\n    &lt;\/ul&gt;\n  &lt;\/li&gt;\n&lt;\/ul&gt;\n<\/code><\/pre>\n<h3 class=\"fz-lg\">3. \u67d4\u8edf\u306a\u30c8\u30ea\u30ac\u30fc\u8a2d\u5b9a<\/h3>\n<p><code>.opener<\/code>\u30af\u30e9\u30b9\u3092\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u69d8\u3005\u306aUI\u30d1\u30bf\u30fc\u30f3\u306b\u5bfe\u5fdc\uff1a<\/p>\n<ul style=\"list-style-type:bullet;\">\n  <li><code>summary<\/code>\u306b\u76f4\u63a5<code>.opener<\/code>\u3092\u4ed8\u3051\u308b \u2192 summary\u5168\u4f53\u304c\u30c8\u30ea\u30ac\u30fc<\/li>\n  <li><code>summary<\/code>\u5185\u306e<code>button<\/code>\u306b<code>.opener<\/code>\u3092\u4ed8\u3051\u308b \u2192 \u30dc\u30bf\u30f3\u306e\u307f\u304c\u30c8\u30ea\u30ac\u30fc<\/li>\n<\/ul>\n<h2 class=\"fz-xl\">\u6539\u826f\u3055\u308c\u305f\u30db\u30d0\u30fc\u6a5f\u80fd<\/h2>\n<h3 class=\"fz-lg\">\u5f93\u6765\u306e\u554f\u984c\u70b9<\/h3>\n<p>\u4e00\u822c\u7684\u306a\u30db\u30d0\u30fc\u578b\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\uff1a<\/p>\n<ul style=\"list-style-type:bullet;\">\n  <li>\u7d20\u65e9\u3044\u30de\u30a6\u30b9\u79fb\u52d5\u3067\u53cd\u5fdc\u304c\u920d\u3044<\/li>\n  <li>\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u4e2d\u306b\u64cd\u4f5c\u304c\u7121\u8996\u3055\u308c\u308b<\/li>\n  <li>\u9023\u6253\u9632\u6b62\u6a5f\u80fd\u304c\u30db\u30d0\u30fc\u3092\u963b\u5bb3<\/li>\n<\/ul>\n<h3 class=\"fz-lg\">\u89e3\u6c7a\u7b56<\/h3>\n<p><b class=\"fw-600\">\u30af\u30ea\u30c3\u30af\u578b\u3068\u30db\u30d0\u30fc\u578b\u3067\u7570\u306a\u308b\u30a2\u30d7\u30ed\u30fc\u30c1<\/b>\u3092\u63a1\u7528\uff1a<\/p>\n<pre><code class=\"language-javascript\">\/\/ \u30af\u30ea\u30c3\u30af\u578b\uff1a\u9023\u6253\u9632\u6b62\u3042\u308a\nconst setupClickAccordion = (element) =&gt; {\n  opener.addEventListener(&quot;click&quot;, (e) =&gt; {\n    \/\/ \u9023\u6253\u9632\u6b62\n    if (isAnimating(element)) return;\n    toggleAccordion(element);\n  });\n};\n\n\/\/ \u30db\u30d0\u30fc\u578b\uff1a\u5373\u5ea7\u306b\u53cd\u5fdc\u3001\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u4e2d\u65ad\u6a5f\u80fd\nconst setupHoverAccordion = (element) =&gt; {\n  summary.addEventListener(&#39;mouseenter&#39;, () =&gt; {\n    if (!isOpen(element)) {\n      \/\/ \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u4e2d\u3067\u3082\u5f37\u5236\u7684\u306b\u958b\u304f\n      openAccordion(element, true);\n    }\n  });\n};\n<\/code><\/pre>\n<h3 class=\"fz-lg\">\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u4e2d\u65ad\u6a5f\u80fd<\/h3>\n<p>\u65e2\u5b58\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4e2d\u65ad\u3057\u3066\u3001\u65b0\u3057\u3044\u64cd\u4f5c\u306b\u5373\u5ea7\u306b\u53cd\u5fdc\uff1a<\/p>\n<pre><code class=\"language-javascript\">const openAccordion = (element, force = false) =&gt; {\n  \/\/ \u65e2\u5b58\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4e2d\u65ad\uff08force\u6642\uff09\n  if (force &amp;&amp; isAnimating(element)) {\n    const existingAnim = element._currentAnimation;\n    if (existingAnim) {\n      existingAnim.cancel();\n    }\n  }\n  \n  \/\/ \u65b0\u3057\u3044\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u958b\u59cb\n  animAccordionContent(content, 0, content.scrollHeight, element);\n};\n<\/code><\/pre>\n<h2 class=\"fz-xl\">\u5b8c\u5168\u306aJavaScript\u5b9f\u88c5<\/h2>\n<pre><code class=\"language-javascript\">(function() {\n\/\/ CSS\u81ea\u52d5\u6ce8\u5165\nconst STYLE = document.createElement(&#39;style&#39;);\nSTYLE.textContent = `\n:is(.clickdion, .hoverdion) :is(\n  .dion-item .dion-content,\n  .menu-item-has-children .sub-menu) {\n  overflow: hidden;\n  transition: all 0.3s ease-out;\n}\n\n:is(.clickdion, .hoverdion) :is(\n  .dion-item:not(.is-open) .dion-content,\n  .menu-item-has-children:not(.is-open) .sub-menu) {\n  height: 0;\n  min-height: 0;\n  padding-block: 0;\n  border-block-width: 0;\n}\n\n\/* \u30a2\u30a4\u30b3\u30f3\u30b9\u30bf\u30a4\u30eb *\/\n.opener::before {\n  content: &quot;\u25bc&quot;;\n  transition: transform 0.3s ease;\n}\n\n.is-open .opener::before {\n  transform: rotate(-180deg);\n}\n`;\ndocument.head.appendChild(STYLE);\n\n\/\/ \u521d\u671f\u5316\ndocument.addEventListener(&quot;DOMContentLoaded&quot;, () =&gt; {\n  \/\/ details\u8981\u7d20\n  document.querySelectorAll(&quot;.clickdion .dion-item&quot;).forEach(setupClickAccordion);\n  document.querySelectorAll(&quot;.hoverdion .dion-item&quot;).forEach(setupHoverAccordion);\n  \n  \/\/ \u30e1\u30cb\u30e5\u30fc\u8981\u7d20\n  document.querySelectorAll(&quot;.clickdion .menu-item-has-children&quot;).forEach(setupClickMenudion);\n  document.querySelectorAll(&quot;.hoverdion .menu-item-has-children&quot;).forEach(setupHoverMenudion);\n});\n\n\/\/ \u30af\u30ea\u30c3\u30af\u578b\u8a2d\u5b9a\uff08\u9023\u6253\u9632\u6b62\u3042\u308a\uff09\nconst setupClickAccordion = (element) =&gt; {\n  const opener = element.querySelector(&quot;.opener&quot;);\n  const summary = element.querySelector(&quot;.dion-summary&quot;);\n  \n  if (!opener) return;\n\n  opener.addEventListener(&quot;click&quot;, (e) =&gt; {\n    e.stopPropagation();\n    e.preventDefault();\n    \n    if (isAnimating(element)) return; \/\/ \u9023\u6253\u9632\u6b62\n    toggleAccordion(element);\n  });\n\n  summary?.addEventListener(&quot;click&quot;, (e) =&gt; e.preventDefault());\n};\n\n\/\/ \u30db\u30d0\u30fc\u578b\u8a2d\u5b9a\uff08\u5373\u5ea7\u306b\u53cd\u5fdc\uff09\nconst setupHoverAccordion = (element) =&gt; {\n  const summary = element.querySelector(&quot;.dion-summary&quot;);\n  const content = element.querySelector(&quot;.dion-content&quot;);\n  \n  if (!summary || !content) return;\n\n  summary.addEventListener(&quot;click&quot;, (e) =&gt; e.preventDefault());\n\n  [&#39;mouseenter&#39;, &#39;focus&#39;].forEach(event =&gt; {\n    summary.addEventListener(event, () =&gt; {\n      if (!isOpen(element)) {\n        openAccordion(element, true); \/\/ \u5f37\u5236\u5b9f\u884c\n      }\n    });\n  });\n\n  [&#39;mouseleave&#39;, &#39;blur&#39;].forEach(event =&gt; {\n    element.addEventListener(event, () =&gt; {\n      if (isOpen(element)) {\n        closeAccordion(element, true); \/\/ \u5f37\u5236\u5b9f\u884c\n      }\n    });\n  });\n};\n\n\/\/ \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u5b9f\u884c\nconst animAccordionContent = (content, fromHeight, toHeight, element, onComplete) =&gt; {\n  element.dataset.animStatus = &quot;action&quot;;\n  \n  const animation = content.animate([\n    { height: fromHeight + &#39;px&#39; },\n    { height: toHeight + &#39;px&#39; }\n  ], {\n    duration: 300,\n    easing: &quot;ease-out&quot;\n  });\n  \n  element._currentAnimation = animation;\n  \n  animation.onfinish = () =&gt; {\n    element.dataset.animStatus = &quot;&quot;;\n    element._currentAnimation = null;\n    onComplete?.();\n  };\n};\n\n\/\/ \u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u95a2\u6570\nconst isAnimating = (element) =&gt; element.dataset.animStatus === &quot;action&quot;;\nconst isOpen = (element) =&gt; element.classList.contains(&quot;is-open&quot;);\n\n})();\n<\/code><\/pre>\n<h2 class=\"fz-xl\">CSS\u8a2d\u5b9a\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n<h3 class=\"fz-lg\">\u57fa\u672c\u7684\u306a\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u69cb\u9020<\/h3>\n<pre><code class=\"language-css\">\/* \u9589\u3058\u305f\u72b6\u614b *\/\n.dion-content,\n.sub-menu {\n  height: 0;\n  overflow: hidden;\n  padding-block: 0;\n  border-block-width: 0;\n}\n\n\/* \u958b\u3044\u305f\u72b6\u614b *\/\n.is-open .dion-content,\n.is-open .sub-menu {\n  height: auto;\n  padding-block: initial;\n  border-block-width: initial;\n}\n<\/code><\/pre>\n<h3 class=\"fz-lg\">Material Symbols\u4f7f\u7528\u6642<\/h3>\n<pre><code class=\"language-css\">.opener::before {\n  font-family: &quot;Material Symbols Sharp&quot;;\n  font-variation-settings: &quot;FILL&quot; 0, &quot;wght&quot; 200;\n  content: &quot;\\e313&quot;; \/* expand_more *\/\n  transition: rotate 0.3s ease;\n}\n\n.is-open .opener::before {\n  rotate: -180deg;\n}\n<\/code><\/pre>\n<h2 class=\"fz-xl\">\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u6642\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n<h3 class=\"fz-lg\">1. \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u901f\u5ea6\u306e\u8abf\u6574<\/h3>\n<pre><code class=\"language-javascript\">\/\/ \u3088\u308a\u9ad8\u901f\u306a\u53cd\u5fdc\u304c\u6b32\u3057\u3044\u5834\u5408\nduration: 200\n\n\/\/ \u3088\u308a\u3086\u3063\u304f\u308a\u3068\u3057\u305f\u52d5\u4f5c\u304c\u6b32\u3057\u3044\u5834\u5408\nduration: 500\n<\/code><\/pre>\n<h3 class=\"fz-lg\">2. \u30a4\u30fc\u30b8\u30f3\u30b0\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba<\/h3>\n<pre><code class=\"language-javascript\">\/\/ \u81ea\u7136\u306a\u52d5\u4f5c\neasing: &quot;ease-out&quot;\n\n\/\/ \u30d0\u30a6\u30f3\u30c9\u52b9\u679c\neasing: &quot;cubic-bezier(0.68, -0.55, 0.265, 1.55)&quot;\n\n\/\/ \u30ea\u30cb\u30a2\neasing: &quot;linear&quot;\n<\/code><\/pre>\n<h3 class=\"fz-lg\">3. \u6392\u4ed6\u5236\u5fa1\u306e\u8ffd\u52a0<\/h3>\n<p>\u540c\u6642\u306b\u958b\u3051\u308b\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u30921\u3064\u306b\u5236\u9650\uff1a<\/p>\n<pre><code class=\"language-javascript\">const openAccordion = (element, force = false) =&gt; {\n  \/\/ \u540c\u3058\u89aa\u8981\u7d20\u5185\u306e\u4ed6\u306e\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u3092\u9589\u3058\u308b\n  const parent = element.closest(&#39;.accordion-group&#39;);\n  if (parent) {\n    parent.querySelectorAll(&#39;.is-open&#39;).forEach(sibling =&gt; {\n      if (sibling !== element) {\n        closeAccordion(sibling, true);\n      }\n    });\n  }\n  \n  \/\/ \u901a\u5e38\u306e\u958b\u304f\u51e6\u7406...\n};\n<\/code><\/pre>\n<h3 class=\"fz-lg\">4. WordPress\u30c6\u30fc\u30de\u3067\u306e\u5b9f\u88c5<\/h3>\n<pre><code class=\"language-php\">\/\/ functions.php\u306b\u8ffd\u52a0\nfunction enqueue_accordion_script() {\n    wp_enqueue_script(\n        &#39;accordion-js&#39;,\n        get_template_directory_uri() . &#39;\/js\/accordion.js&#39;,\n        array(),\n        &#39;1.0.0&#39;,\n        true\n    );\n}\nadd_action(&#39;wp_enqueue_scripts&#39;, &#39;enqueue_accordion_script&#39;);\n\n\/\/ \u30e1\u30cb\u30e5\u30fc\u306b\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\nfunction add_accordion_classes($classes, $item, $args) {\n    if (in_array(&#39;menu-item-has-children&#39;, $classes)) {\n        $classes[] = &#39;hoverdion&#39;; \/\/ \u307e\u305f\u306f &#39;clickdion&#39;\n    }\n    return $classes;\n}\nadd_filter(&#39;nav_menu_css_class&#39;, &#39;add_accordion_classes&#39;, 1, 3);\n<\/code><\/pre>\n<h2 class=\"fz-xl\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316<\/h2>\n<h3 class=\"fz-lg\">1. CSS containment<\/h3>\n<pre><code class=\"language-css\">.dion-content,\n.sub-menu {\n  contain: layout style paint;\n}\n<\/code><\/pre>\n<h3 class=\"fz-lg\">2. will-change \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<pre><code class=\"language-css\">.dion-content,\n.sub-menu {\n  will-change: height;\n}\n\n\/* \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u5b8c\u4e86\u5f8c\u306f\u524a\u9664 *\/\n.dion-content:not(.animating),\n.sub-menu:not(.animating) {\n  will-change: auto;\n}\n<\/code><\/pre>\n<h3 class=\"fz-lg\">3. \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u6700\u9069\u5316<\/h3>\n<pre><code class=\"language-javascript\">\/\/ \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u958b\u59cb\u6642\ncontent.style.willChange = &#39;height&#39;;\n\n\/\/ \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u5b8c\u4e86\u6642\nanimation.onfinish = () =&gt; {\n  content.style.willChange = &#39;auto&#39;;\n  \/\/ \u305d\u306e\u4ed6\u306e\u51e6\u7406...\n};\n<\/code><\/pre>\n<h2 class=\"fz-xl\">\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/h2>\n<h3 class=\"fz-lg\">\u3088\u304f\u3042\u308b\u554f\u984c\u3068\u89e3\u6c7a\u7b56<\/h3>\n<p><b class=\"fw-600\">Q: \u30db\u30d0\u30fc\u6642\u306b\u7d20\u65e9\u304f\u79fb\u52d5\u3059\u308b\u3068\u53cd\u5fdc\u3057\u306a\u3044<\/b><br \/>\n  A: \u672c\u5b9f\u88c5\u3067\u306f<code>force<\/code>\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u4e2d\u65ad\u6a5f\u80fd\u3092\u5b9f\u88c5\u6e08\u307f<\/p>\n<p><b class=\"fw-600\">Q: Material Symbols\u304c\u8868\u793a\u3055\u308c\u306a\u3044<\/b><br \/>\n  A: \u30d5\u30a9\u30f3\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u3092\u78ba\u8a8d\uff1a<\/p>\n<pre><code class=\"language-html\">&lt;link href=&quot;https:\/\/fonts.googleapis.com\/css2?family=Material+Symbols+Sharp&quot; rel=&quot;stylesheet&quot;&gt;\n<\/code><\/pre>\n<p><b class=\"fw-600\">Q: WordPress\u3067\u30e1\u30cb\u30e5\u30fc\u304c\u52d5\u4f5c\u3057\u306a\u3044<\/b><br \/>\n  A: \u30e1\u30cb\u30e5\u30fc\u69cb\u9020\u3068\u30af\u30e9\u30b9\u540d\u3092\u78ba\u8a8d\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066PHP\u3067\u30af\u30e9\u30b9\u3092\u8ffd\u52a0<\/p>\n<h2 class=\"fz-xl\">\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u4f5c\u6210\u3057\u305f\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u306e\u7279\u5fb4\uff1a<\/p>\n<ul style=\"list-style-type:bullet;\">\n  <li><b class=\"fw-600\">\u7528\u9014\u5225\u6700\u9069\u5316<\/b>\uff1a\u30af\u30ea\u30c3\u30af\u578b\u306f\u5b89\u5b9a\u6027\u3001\u30db\u30d0\u30fc\u578b\u306f\u53cd\u5fdc\u901f\u5ea6\u3092\u91cd\u8996<\/li>\n  <li><b class=\"fw-600\">\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u4e2d\u65ad<\/b>\uff1a\u7d20\u65e9\u3044\u64cd\u4f5c\u306b\u3082\u5373\u5ea7\u306b\u5bfe\u5fdc<\/li>\n  <li><b class=\"fw-600\">\u6c4e\u7528\u6027<\/b>\uff1adetails\u30bf\u30b0\u3068WordPress\u30e1\u30cb\u30e5\u30fc\u306e\u4e21\u65b9\u306b\u5bfe\u5fdc<\/li>\n  <li><b class=\"fw-600\">\u81ea\u52d5CSS\u6ce8\u5165<\/b>\uff1aJavaScript\u30d5\u30a1\u30a4\u30eb1\u3064\u3067\u5b8c\u7d50<\/li>\n  <li><b class=\"fw-600\">\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u6027<\/b>\uff1a\u8c4a\u5bcc\u306a\u8a2d\u5b9a\u30aa\u30d7\u30b7\u30e7\u30f3<\/li>\n<\/ul>\n\n<p>\u69d8\u3005\u306a\u8981\u4ef6\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u67d4\u8edf\u6027\u3092\u91cd\u8996\u3001\u7279\u306bWordPress\u306e\u6a19\u6e96\u30e1\u30cb\u30e5\u30fc\u69cb\u9020\u3067\u30db\u30d0\u30fc\u3067\u3082\u30af\u30ea\u30c3\u30af\u3067\u3082\u4f7f\u3048\u308b\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u30e1\u30cb\u30e5\u30fc\u3067\u3059\u3002<\/p>","protected":false},"excerpt":{"rendered":"Web\u30b5\u30a4\u30c8\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u6a5f\u80fd\u3002\u4eca\u56de\u306f\u3001\u30af\u30ea\u30c3\u30af\u6642\u3068\u30db\u30d0\u30fc\u6642\u306e\u4e21\u65b9\u306b\u5bfe\u5fdc\u3057\u3001\u304b\u3064details\u30bf\u30b0\u3067\u3082WordPress\u30e1\u30cb\u30e5\u30fc\u3067\u3082\u4f7f\u3048\u308b\u6c4e\u7528\u6027\u306e\u9ad8\u3044\u30a2\u30b3\u30fc\u30c7\u30a3\u30aa\u30f3\u3092\u76ee\u6307\u3057\u307e\u3057\u305f\u306b\u30db\u30d0\u30fc\u578b\u3067\u306f\u7d20\u65e9\u3044\u30de\u30a6\u30b9\u64cd[...]","protected":false},"author":1,"featured_media":7968,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7,8],"tags":[286,287,288,289,180,148,149],"group":[],"pg":[],"class_list":["post-7966","post","type-post","status-publish","format-standard","has-post-thumbnail","category-html-css","category-javascript","tag-286","tag-287","tag-288","tag-289","tag-ui","tag-javascript","tag-dom"],"acf":[],"_links":{"self":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/7966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/comments?post=7966"}],"version-history":[{"count":0,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/7966\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media\/7968"}],"wp:attachment":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media?parent=7966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/categories?post=7966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/tags?post=7966"},{"taxonomy":"group","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/group?post=7966"},{"taxonomy":"pg","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/pg?post=7966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}