I have the following HTML snippet:
<div id="container">
<div id="feedbackBox"></div>
</div>
The #feedbackBox div is initially not visible.
To center the div, the CSS code is used:
#container {
position: absolute; width: 380px; height: 360px; left: 50%; top:50%; padding: 30px;
margin-left: -220px; margin-top: -210px;
}
Now, I want to change the height
of #feedbackbox using jQuery.
Here is what I tried:
.expandInfo {
height: 500px;
margin-top: -221px;
}
$("#container").removeClass().addClass('expandInfo');
However, it doesn't seem to work! The CSS class is not applied and the centralized positioning is lost.