Note that there are some explanatory texts on larger screens.

plurals
  1. PONested ordered toggled list, non repeating
    primarykey
    data
    text
    <p>I am coding a dichotomous key: an ordered, toggled list with two options to choose from at each level. The nested items cannot repeat numbers later, but increase in numbering. The numbers need 'a' and 'b' appended:</p> <blockquote> <p>1a.</p> <blockquote> <p>2a.</p> <blockquote> <p>3a.</p> <p>3b.</p> </blockquote> <p>2b.</p> <blockquote> <p>4a.</p> <p>4b.</p> </blockquote> </blockquote> <p>1b.</p> <blockquote> <p>5a.</p> <blockquote> <p>6a.</p> <p>6b.</p> </blockquote> <p>5b.</p> <blockquote> <p>7a.</p> <p>7b.</p> </blockquote> </blockquote> </blockquote> <p>Basic HTML ordered list:</p> <pre><code>&lt;ol&gt; &lt;li&gt;1a &lt;ol&gt; &lt;li&gt;2a &lt;ol&gt; &lt;li&gt;3a&lt;/li&gt; &lt;li&gt;3b&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;li&gt;2b &lt;ol&gt; &lt;li&gt;4a&lt;/li&gt; &lt;li&gt;4b&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;/ol&gt; </code></pre> <p></li></p> <pre><code>&lt;ol&gt; &lt;li&gt;1b &lt;ol&gt; &lt;li&gt;3a &lt;ol&gt; &lt;li&gt;5a&lt;/li&gt; &lt;li&gt;5b&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;li&gt;2b &lt;ol&gt; &lt;li&gt;6a&lt;/li&gt; &lt;li&gt;6b&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;/ol&gt; </code></pre> <p></li></p> <p>The nested items need to toggle visibility, which can be done with JQuery and display:none DIVs, but is there a way to avoid DIVs? Unless each listed item is automatically placed inside a DIV, the key is too large to hand number with "1a", "1b."</p> <p>JQuery toggling:</p> <pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function toggleDiv(divId) { $("#"+divId).toggle(); } &lt;/script&gt; </code></pre> <p>The accompanying CSS:</p> <pre><code>.display {display:none; padding-left: 30px; } </code></pre> <p>What mix of JQuery and CSS countering do I need to get the nested items to pick up numbering where it left off, not restart it? The nesting needs to go to unlimited levels deep, while never repeating numbers anywhere in the list.</p> <p>How can I adapt the following CSS to add letters, not decimal numbers?:</p> <pre><code> &lt;style&gt; html&gt;/**/body ol { /* Won't be interpreted by IE6/7. */ list-style-type: none; counter-reset: level1; } ol li:before { content: counter(level1) ". "; counter-increment: level1; } ol li ol { list-style-type: none; counter-reset: level2; } ol li ol li:before { content: counter(level1) "." counter(level2) " "; counter-increment: level2; } ol li span { /* For IE6/7. */ margin: 0 5px 0 -25px; } &lt;/style&gt; </code></pre> <p>Questions on nested lists, or changing numbering style, have been asked, but I can't find one with this non-repeating numbering, with toggled options. See- <a href="https://stackoverflow.com/questions/1852816/nested-ordered-lists">Nested ordered lists</a> and <a href="https://stackoverflow.com/questions/9988559/slide-toggle-nested-ordered-list">Slide Toggle nested ordered list</a></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.
 

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