title: Blind-like animation with CSS3 only
body: <p>I want to toggle notification with jQuery UI-like blind effect: <a href="http://jqueryui.com/toggle/" rel="nofollow" title="jQuery UI blind effect">jQuery UI blind effect</a></p>
  
  <p>To achieve it, I created CSS3 animations:</p>
  
  <pre><code>.blind-top-in{
      -webkit-animation-duration: 2s;
      -webkit-animation-name: blindTopIn;
      animation-duration: 2s;
      animation-name: blindTopIn;
  }
  
  .blind-top-out{
     -webkit-animation-duration: 2s;
     -webkit-animation-name: blindTopOut;
     animation-duration: 2s;
     animation-name: blindTopOut;
  }
  
  @-webkit-keyframes blindTopIn{
      from{
          max-height: 0px;
          height: 0 !important;
  }
      to{
          max-height: 75px;
          height: auto !important;
      }
  }
  @-webkit-keyframes blindTopOut{
      from{
          max-height: 75px;
          height: auto !important;
      }
      to{
          max-height: 0px;
          height: 0 !important;
      }
  }
  @keyframes blindTopIn{
      from{
          max-height: 0px;
          height: 0 !important;
      }
      to{
          max-height: 75px;
          height: auto !important;
      }
  }
  @keyframes blindTopOut{
      from{
          max-height: 75px;
          height: auto !important;
      }
      to{
          max-height: 0px;
          height: 0 !important;
      }
  }
  </code></pre>
  
  <p>And idea is that it should blind from 0px width to auto/75px and backwards.
  Unfortunately, this is not working - it looks like "half-height notification" appears and animate to normal height, then if I add <code>blind-top-out</code> class it animate to half-height and then dissapears without animation. What am I doing wrong? I would be very happy if anybody decides to help me - thank you in advance.</p>
  
  <p>Snippet - working not exactly like it should (I don't know why), but you see that animation animate only "half" of notification</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.blind-top-in{
      -webkit-animation-duration: 2s;
      -webkit-animation-name: blindTopIn;
      animation-duration: 2s;
      animation-name: blindTopIn;
  }
  
  .blind-top-out{
     -webkit-animation-duration: 2s;
     -webkit-animation-name: blindTopOut;
     animation-duration: 2s;
     animation-name: blindTopOut;
  }
  
  @-webkit-keyframes blindTopIn{
      from{
          max-height: 0px;
          height: 0 !important;
  }
      to{
          max-height: 75px;
          height: 75px !important;
      }
  }
  @-webkit-keyframes blindTopOut{
      from{
          max-height: 75px;
          height: 75px !important;
      }
      to{
          max-height: 0px;
          height: 0 !important;
      }
  }
  @keyframes blindTopIn{
      from{
          max-height: 0px;
          height: 0 !important;
      }
      to{
          max-height: 75px;
          height: 75px !important;
      }
  }
  @keyframes blindTopOut{
      from{
          max-height: 75px;
          height: 75px !important;
      }
      to{
          max-height: 0px;
          height: 0 !important;
      }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;TODO supply a title&lt;/title&gt;
          &lt;meta charset="windows-1250"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
          &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"&gt;
          &lt;!-- Optional theme --&gt;
          &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"&gt;
          
          &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt;
              
          &lt;script type="text/javascript"&gt;
              "use strict";
              $(document).ready(function(){
                  $("#showBtn").click(function(){
                        $("#notification").addClass("blind-top-in").removeClass("blind-top-out")});
                    $("#hideBtn").click(function(){
                        $("#notification").addClass("blind-top-out").removeClass("blind-top-in");
                  });
              });
              
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body class="container"&gt;
        &lt;div id="notification" class="alert alert-info"&gt;Notify user&lt;/div&gt;
              &lt;button id="showBtn" class="btn btn-success btn-sm" style="margin-top: 50px;"&gt;Show&lt;/button&gt;
        &lt;button id="hideBtn" class="btn btn-danger btn-sm" style="margin-top: 80px;"&gt;Hide&lt;/button&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>