Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As others have pointed out in the comments, CSS animations don't appear to support using a height value of <code>auto</code>, with one solution being to use a fixed height instead.</p> <p>If you need to support a dynamic height, you could measure the height with jQuery and then apply the measured height to the animation.</p> <p>One possible way is to add a container around <code>#teaserbar</code>. Set the container to the measured height, and use start and end values of 0% and 100% for the animation. A quick test using 0% and 100% was successful, for an element in a fixed-height container. Not sure if this solution would present problems with the page layout, but there may be other ways to make use of the measured height that would not do so.</p> <p><strong>Demos</strong> &nbsp; (targetting Webkit browsers only)</p> <ul> <li><a href="http://jsfiddle.net/Matt_Coughlin/LPKce/2/" rel="nofollow">Fixed-height container</a> &nbsp; (no jQuery)</li> <li><a href="http://jsfiddle.net/Matt_Coughlin/HmXH5/" rel="nofollow">Dynamic-height container</a> &nbsp; (uses jQuery)</li> </ul> <p><strong>HTML</strong></p> <pre><code>&lt;div id="container"&gt; &lt;div id="teaserbar"&gt; &lt;p&gt;&lt;a href="#jumper"&gt;Lorem ipsum dolor sit amet! &amp;#8681;&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>@-webkit-keyframes barAppear { from { height: 0% } to { height: 100%; } } </code></pre> <p><strong>jQuery</strong></p> <pre><code>$(document).ready(function(){ $('#container').height( $('#teaserbar').height() ); }); </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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