html.de - JQuery animate mehrmals das selbe Atribut

by SpiceLab

HTML

<div id="rfidPage">
  <div id="menu"></div>
</div>

CSS

#rfidPage #menu {   
   width:20vw;
   height:100vh;
   background-color:red;
}

JavaScript

(function animation() {
   var options = {
      duration: 500,
      easing: 'linear'
   };

   $('#rfidPage')
      .find('#menu')
      .animate({
            height: "5vw"            
         },
         options
      )
      .animate({
            "height": "+=4vh"
         },
         $.extend(true, {}, options, {
            complete: function() {
               animation();
            }
       })
    );
})();