- How do I refresh auto margins when I resize an element using Javascript?
- <div id="content" style="margin-left:auto;margin-right:auto;width:240px">
- <p>Lots of text</p>
- </div>
- $("#content").width(480);
- <div id="content" style="margin-left:auto;margin-right:auto;width:240px;border:1px solid red;text-align:center">
- <p>Click here</p>
- $('p').click(function(){$("#content").width(480)})