0

I'd like to to create a div and then animate it to 100% width and height. The problem is that newly created div becomes bigger in one direction. Is it possible to make div bigger in all 4 directions?

$('<div/>', {
    'id': 'fullinfo',
    'style': ' width: 80%;height: 100px;background:black;border: none;position:absolute;left:10%;top:30%;z-index:0;'
}).appendTo('body');

$('#fullinfo').animate({
    width: "100%",
    height: "100%",
}, 800);
Tushar
  • 85,780
  • 21
  • 159
  • 179
  • 1
    how about this solution: http://stackoverflow.com/questions/10351431/grow-from-center-animation-with-jquery – navotgil May 26 '15 at 13:38

1 Answers1

0

You can use scale, or change the position on animation (add top 0, bottom 0), that will give the effect of growing from the center.

alexmattorr
  • 362
  • 4
  • 15