javascript - Div height animation causes divs to change alignment in jQuery -



javascript - Div height animation causes divs to change alignment in jQuery -

i'm trying animate height of 5 divs on click of button. although these divs increment in size animation causes divs align @ top rather bottom. if makes sense. i prefer animate while coming downwards top (so aligned top) if other way around, animation completes changes divs locations.

class="snippet-code-js lang-js prettyprint-override">$("button").click(function(){ $("#f").css("display", "inline"); $(".css").css("display", "inline"); $(".html").css("display", "inline"); $(".jquery").css("display", "inline"); $(".premiere").css("display", "inline"); $(".photoshop").css("display", "inline"); $(".css").animate({height:'300'}, 600); $(".html").animate({height:'300'}, 600); $(".jquery").animate({height:'125'}, 600); $(".premiere").animate({height:'250'}, 600); $(".photoshop").animate({height:'325'}, 600); }); class="snippet-code-css lang-css prettyprint-override">p{ transform: rotate(270deg); margin-top: 60px; } #f, .css, .html, .jquery, .premiere, .photoshop{ height: 0px; width: 30px; display: none; background-color: blue; } .css{ background-color: bluish } .html{ background-color: reddish } .jquery{ background-color: orange } .premiere{ background-color: violet } .photoshop{ background-color: yellowish } class="snippet-code-html lang-html prettyprint-override"><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <button>go</button> <div></div> <div class="f"> <div class="html"><p>html</p></div> <div class="css"><p>css</p></div> <div class="jquery"><p>jquery</p></div> <div class="premiere"><p>premiere</p></div> <div class="photoshop"><p>photoshop</p></div> </div>

add vertical-align: bottom .jquery, .html, .premiere, .photoshop , .css.

updated fiddle

javascript jquery html jquery-animate height

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -