<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans">
	<id>http://scr.wiki/index.php?action=history&amp;feed=atom&amp;title=%E7%94%A8%E6%88%B7%3ABy_H%2Fcommon.js</id>
	<title>用户:By H/common.js - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://scr.wiki/index.php?action=history&amp;feed=atom&amp;title=%E7%94%A8%E6%88%B7%3ABy_H%2Fcommon.js"/>
	<link rel="alternate" type="text/html" href="http://scr.wiki/index.php?title=%E7%94%A8%E6%88%B7:By_H/common.js&amp;action=history"/>
	<updated>2026-04-14T13:30:04Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>http://scr.wiki/index.php?title=%E7%94%A8%E6%88%B7:By_H/common.js&amp;diff=128&amp;oldid=prev</id>
		<title>By H：​创建页面，内容为“document.addEventListener(&quot;DOMContentLoaded&quot;, () =&gt; {   const headers = document.querySelectorAll(&#039;.scr-collapse-header&#039;);    headers.forEach(header =&gt; {     const content = header.nextElementSibling;     const symbol = header.querySelector(&#039;.scr-collapse-symbol&#039;);      const textOpen = header.getAttribute(&#039;data-text-open&#039;) || &#039;＋ 展开&#039;;     const textClose = header.getAttribute(&#039;data-text-close&#039;) || &#039;－ 收起&#039;;     const defaultState = header.getAttribute…”</title>
		<link rel="alternate" type="text/html" href="http://scr.wiki/index.php?title=%E7%94%A8%E6%88%B7:By_H/common.js&amp;diff=128&amp;oldid=prev"/>
		<updated>2026-01-06T18:19:56Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“document.addEventListener(&amp;quot;DOMContentLoaded&amp;quot;, () =&amp;gt; {   const headers = document.querySelectorAll(&amp;#039;.scr-collapse-header&amp;#039;);    headers.forEach(header =&amp;gt; {     const content = header.nextElementSibling;     const symbol = header.querySelector(&amp;#039;.scr-collapse-symbol&amp;#039;);      const textOpen = header.getAttribute(&amp;#039;data-text-open&amp;#039;) || &amp;#039;＋ 展开&amp;#039;;     const textClose = header.getAttribute(&amp;#039;data-text-close&amp;#039;) || &amp;#039;－ 收起&amp;#039;;     const defaultState = header.getAttribute…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;document.addEventListener(&amp;quot;DOMContentLoaded&amp;quot;, () =&amp;gt; {&lt;br /&gt;
  const headers = document.querySelectorAll(&amp;#039;.scr-collapse-header&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
  headers.forEach(header =&amp;gt; {&lt;br /&gt;
    const content = header.nextElementSibling;&lt;br /&gt;
    const symbol = header.querySelector(&amp;#039;.scr-collapse-symbol&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
    const textOpen = header.getAttribute(&amp;#039;data-text-open&amp;#039;) || &amp;#039;＋ 展开&amp;#039;;&lt;br /&gt;
    const textClose = header.getAttribute(&amp;#039;data-text-close&amp;#039;) || &amp;#039;－ 收起&amp;#039;;&lt;br /&gt;
    const defaultState = header.getAttribute(&amp;#039;data-default&amp;#039;) || &amp;#039;closed&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
    if (defaultState === &amp;#039;open&amp;#039;) {&lt;br /&gt;
      content.style.maxHeight = content.scrollHeight + &amp;quot;px&amp;quot;;&lt;br /&gt;
      symbol.textContent = textClose;&lt;br /&gt;
    } else {&lt;br /&gt;
      content.style.maxHeight = &amp;quot;0&amp;quot;;&lt;br /&gt;
      symbol.textContent = textOpen;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    header.addEventListener(&amp;#039;click&amp;#039;, () =&amp;gt; {&lt;br /&gt;
      if (content.style.maxHeight &amp;amp;&amp;amp; content.style.maxHeight !== &amp;quot;0px&amp;quot;) {&lt;br /&gt;
        content.style.maxHeight = &amp;quot;0&amp;quot;;&lt;br /&gt;
        symbol.textContent = textOpen;&lt;br /&gt;
      } else {&lt;br /&gt;
        content.style.maxHeight = content.scrollHeight + &amp;quot;px&amp;quot;;&lt;br /&gt;
        symbol.textContent = textClose;&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
});&lt;/div&gt;</summary>
		<author><name>By H</name></author>
	</entry>
</feed>