jquery - slide div from bottom -
i have 640x480 div centered vertically , horizontally within html page. want div appear bottom edge of div. want div 640x400. essentially, top 80px of original div can seen.
my question is, how make new div appear bottom edge of centered div?
i dont got css but, recomend make center div position:relative; make div thats should animated absolute. working example animation here http://jsbin.com/iqewuh/3/edit css:
#i { width:640px; height:480px; background:red; position:relative; } #y { position:absolute; background:green; bottom:0; width:640px; } html:
<div id="i"> <div id="y"></div> </div> <a href="#!" id="animate">animate</a> js:
$(document).ready(function() { $("#animate").click(function() { $("#y").animate({ height: '+=400' }, 5000); }); });
Comments
Post a Comment