Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS Transition Accordion Radio Doesn't work using height: auto or max-height (Edited)
    primarykey
    data
    text
    <p>Using radio buttons to trigger hidden/shown accordion menu. <strike>Works in jsfiddle... Does not work in any other browser I've tried. I'm assuming its something small I've miss typed or am missing or I'm totally lost. I'm aware not everything works right in all browsers/setups/etc but from what I've read/understood this work?</strike></p> <p>EDIT: max-height does not work in jsfiddle either... So this must be the problem. Basically I want the ul to auto expand to the length of it's li list. So using a fixed height will not work. height: auto; as well as max-height; neither work..</p> <p>Any and all help is appreciated it.</p> <p>HTML</p> <pre><code>&lt;section class="container"&gt; &lt;div&gt; &lt;input id="test1" name="acctest" type="radio" checked /&gt; &lt;label for="test1"&gt;About us&lt;/label&gt; &lt;ul&gt; &lt;li&gt;test&lt;/li&gt; &lt;li&gt;test2&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;input id="test2" name="acctest" type="radio" /&gt; &lt;label for="test2"&gt;About us&lt;/label&gt; &lt;ul&gt; &lt;li&gt;test&lt;/li&gt; &lt;li&gt;test2&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p></p> <p>CSS</p> <pre><code>.container ul{ background: rgba(255, 255, 255, 0.5); margin: 0px; overflow: hidden; height: 0px; position: relative; margin: 0; z-index: 1; -webkit-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; -moz-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; -o-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; -ms-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; transition: height 0.5s ease-in-out, box-shadow 0.9s linear;} .container li{ height: 25px; color: #000; font-size: 12px;} .container input:checked ~ ul{ -webkit-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; -moz-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; -o-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; -ms-transition: height 0.5s ease-in-out, box-shadow 0.9s linear; transition: height 0.5s ease-in-out, box-shadow 0.9s linear; max-height: 50px;} </code></pre> <p>UPDATED jsfiddle link: <a href="http://jsfiddle.net/ETaXr/2/" rel="nofollow">http://jsfiddle.net/ETaXr/2/</a></p> <p>Thanks again!</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.
 

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