jquery - JavaScript animate resizing div -


I'm trying to put a small animation on one page. On my side there is 2 divisas, the second of which has its content called through Ajax, so the height of the divis is different without refreshing the page.

  & lt; Div id = "number1" style = "float: left; padding-down: 140px" & gt; Static content, 200 px or so & lt; / Div & gt; & Lt; Div id = "number2" style = "float: left" & gt; AJAX Content Here & lt; / Div & gt; & Lt; Div style = "clear: left" & gt; & Lt; / Div & gt; It basically gives me a 2 column layout, and the image nest under the left hand column does not matter if I & lt; Img src = "image" margin-top: -140px "/>  

What I'm trying to do is to transmit image transition Animate the page when the page height comes thanks to the Ajax content. At present and above the image shock, I want to calm the page easily.

Is it possible? I'm not in my JavaScript, so I'm not sure how to do this. GIL Library on the site, why not Is it a way forward?

OK, I just put a very quick and dirty example .

Here's HTML:

    

The use of jQuery is here

  jQuery (function ($) {var added HTML = "& lt; p class = 'added' & gt; For information about sitting AMT, Nun Punch, Magna Queen Octak Matisse, Laurem New Lobertis Mesa, AC Comodo Masta Same and now New Mechanic Tower, Vehicle or Vehicle Vehicle Station, motorcycle traffic, and lieutenant; / P & gt; Click "$" ("# Addcontent") (function (e) {$ ("# right"). Attachment (Added HTML); var truehite = $ ("#right") height (); // left Animate this column $ ("# left"). Animate ({height: right heit}, 1500);});});  

and CSS:

  #outerContainer {location: relative; border: 1px solid red; margin: 20px auto 0; hidden wavelength; width: 400px;} .col {width: 180px; display: inline; padding: 0 40px;} Left {float: left; border: 1 px solid cyan; position: relative;} # left IMG {status: full; bottom: 0; left: 0;} # right {position: full; top: 0; Left: 180px; limit: 1px solid green;} #addContent {text -align: center; Width: 100px; Margin: 20 px auto 0; Display: block;}  

I've added a button to add some 'Ajax' content when you do this, it grabs the new height of the div and animates that height

I hope this will be helpful.

You can add some ease to the animation or change the speed to make it a bit more polished.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -