Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The best way to order it would be like this</p> <pre><code>&lt;div id="accordion"&gt; &lt;h3 class="accordion title"&gt;Title&lt;/h3&gt; &lt;div class="accordion section"&gt; Section Content &lt;/div&gt; &lt;h3 class="accordion title"&gt;Title 2&lt;/h3&gt; &lt;div class="accordion section"&gt; Section Content &lt;/div&gt; &lt;h3 class="accordion title"&gt;Title 3&lt;/h3&gt; &lt;div class="accordion section"&gt; Section Content &lt;/div&gt; &lt;h3 class="accordion title"&gt;Title 4&lt;/h3&gt; &lt;div class="accordion section"&gt; Section Content &lt;/div&gt; &lt;/div&gt; </code></pre> <p>You would want to avoid <code>z-order</code> entirely because it is a compatibility mess. Instead you would have the accordion titles be what you would click to open the accordion. You would want to set all of the accordion section <code>&lt;div&gt;</code>'s to <code>visibility:hidden;</code> by default, and then, when one of them is clicked, change it's visibility, and hide all the others. If you want it to work with any amount of accordion sections, you would have it count each <code>&lt;h3 class="accordion title"&gt;</code> and each <code>&lt;div class="accordion section"&gt;</code>, and pair those up into an array. When a title is clicked, show it's corresponding div. Alternatively you could give each one a separate ID, but the first way would be much more useful.</p> <p>Actually, it might be <code>display:none;</code> instead of <code>visibility:hidden;</code>, I would try both.</p> <p>In addition it's worth mentioning that the animation is usually handled by changing things like the size of the div, so if you were hiding a section, you would make the height smaller and smaller until it reaches 0 and is hidden.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload