Note that there are some explanatory texts on larger screens.

plurals
  1. PO.js show hide hidden div within hidden div
    primarykey
    data
    text
    <p>Thank you in advance for your help! It's my first post, wasn't sure about the formatting so I hope I've done it correctly.</p> <p>I'd like to know if I can show/hide hidden Nested divs using the following script taken from <a href="http://www.huntingground.freeserve.co.uk/main/mainfram.htm?../style/lyr_swap.htm" rel="nofollow">http://www.huntingground.freeserve.co.uk/main/mainfram.htm?../style/lyr_swap.htm</a>:</p> <pre><code>&lt;script type="text/javascript"&gt; function swapLyr(num) { idCount=0 while(document.getElementById("mydiv"+idCount)){ el=document.getElementById("mydiv"+idCount) if(idCount != num){ el.style.display="none" } else{ el.style.display="block" } idCount++ } } &lt;/script&gt; &lt;ul&gt; &lt;li onclick="swapLyr(0)"&gt;Show Green&lt;/li&gt; &lt;li onclick="swapLyr(1)"&gt;Show Yellow&lt;/li&gt; &lt;li onclick="swapLyr(2)"&gt;Show Red&lt;/li&gt; &lt;li onclick="swapLyr(3)"&gt;Show Blue&lt;/li&gt; &lt;/ul&gt; &lt;div id="mydiv0" style="display:none;background-color:#00AA00;width:350px; height:260px"&gt;Green&lt;/div&gt; &lt;div id="mydiv1" style="display:none;background-color:#AAAA00;width:350px; height:260px"&gt;Yellow&lt;/div&gt; &lt;div id="mydiv2" style="display:none;background-color:#AA0000;width:350px; height:260px"&gt;Red&lt;/div&gt; &lt;div id="mydiv3" style="display:none;background-color:#0000AA;width:350px; height:260px"&gt;Blue&lt;/div&gt; </code></pre> <p>I would like to use something like:</p> <pre><code>&lt;div id="mydiv3" style="display:none;background-color:#0000AA;width:350px; height:260px"&gt;Blue&lt;br /&gt;&lt;br /&gt; &lt;a href="#null" onclick="swapLyr(5)"&gt;Show Hidden Div within this Div&lt;/li&gt; &lt;div id="mydiv5" style="display:none;background-color:#FFF;width:300px; height:210px"&gt;Hidden Div Within "Blue" div&lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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