So I have a div that is displayed by default. I’m using a function to slideUp the element, then change the content, then slideDown back to reveal the new info.
And that’s all working fine.
What’s bothering me is that when the div is animating everything below it follows it up and down.
Basically, it seems like as it’s hiding it’s “display: none” -ing so to speak, meaning it’s being taken out of the flow.
And I want it to be more like “visibility: hidden”.
…if that makes sense (God, I hope it does. It has been a long week. =P)
Elements slide up to fill gaps when above elements are removed. For HTML, gravity is upward, which is why we build HTML downward(from the top of the browser, down).
Let’s pretend your object sliding upward is as follows:
What you need to do is wrap that div in another div that holds the same height:
This way, when the first element crushes, the gap will be held open by the parent div.