View Full Version : Trouble hiding/overlapping divs with DHTML/CSS

Aug 19th, 2007, 12:46 AM
I am trying to create a user interface. Basically, I am implementing a game in X3D, but X3D doesn't really have any means to create a GUI, so that part will be in the webpage itself.

Specifically, I want to be able to hide/show the X3D div.

At first, I tried manipulating the style.display attribute, but that caused Firefox to crash. I was told that messing around with display was a bad idea.

Next, I tried manipulating the style.visibility attribute. That worked in the sense that the X3D div was no longer displayed, but space for it was still allocated. So basically, there was a bunch of empty whitespace where the div used to be. That pretty much defeated the purpose of hiding it.

I am experimenting with putting two divs in the same space, and mainpulating their z-index, but so far no luck.

So my question is: is there a simple way to dynamically hide and deallocate space for a div that I am missing? Let me know if some code would make my problem clearer.