Hi all,
Simple Javascript issue, but as I don't use Javascript so much I thought I'd ask here.
I've got some <div> elements on my page that divide up my content into sections (as you might expect) and I've got some Javascript that shows/hides the <div> elements using code similar to the following:
document.getElementById("some-div-element").style.visibility = "hidden";
This works and all, but although it hides the element, it leaves a bloody great gap where the content used to be. So if I have multiple sections hidden in the middle of the page, there's just a load of whitespace where the <div> elements used to be.
So my question - when you hide elements, how do you "collapse" them so that when they're hidden, they don't still take up lots of space on the page?
I'm using IE for this, so it only needs to work for IE. Thanks!