Click to See Complete Forum and Search --> : including nested divs in the visibility of their nest
Pierre Rouillet
09-02-2003, 10:21 AM
hey boys
here's another one. I had this idea to nest divs in divs who's visibility is being toggled by a JavaScript, hoping the nested ones would disappear with their nests. Unfortunately, they don't, even if the z-index is set to the same value (I'm not sure if that has anything to do with it, I admit).
Of course I could write a lengthy and unelegant script that would make every single subdiv invisible. But isn't there a more clever way to do this?
To see what I mean: http://www.steffiweismann.de/lager/inaktuell/gogo6.html. If you open'page2', and then one of the sublayers, and then click page1, page2 (which is Layer3 in the script) disappears, but the nested div remains visible.
DaveSW
09-02-2003, 10:47 AM
OK just been testing:
IE6, Mozilla 1.4: Problem is as you describe
Opera 7.1: works properly.
First thing I would say is that you shouldn't really use javascript for your navigation. You could use Iframes, or just normal pages, but javascript renders your page inoperable for the 13% of people who don't have javascript. Unless ofcourse the pages are for private use by a set number of machines who will have javascript enabled.
Beyond that, I don't know.
Pierre Rouillet
09-02-2003, 11:14 AM
hi Dave
well, I'd love to do without JavaScript, but iFrames are not an option in this case (I would have simply used regular frames if they were), because there will be flash content on some of those divs, and this way the links on the left serve as tabs (you choose another one, and when you come back, the flash movie is still where you've left it - which is what I hope to achieve with them nested divs, as well. I don't know if there would be a way to do this without JavaScript.
DaveSW
09-02-2003, 11:30 AM
I'm afraid I don't do Javascript. Do you want the thread moved to Javascript?
Pierre Rouillet
09-02-2003, 01:38 PM
maybe that's a good idea. If there's no css/html-way for that, then, yes.
I'd like to briefly outline what would be the use of this: if it would work, and if the hidden layer would, when made visible again, appear with its sublayers in the same state as before, we would have tab functionality within a website. Whenever clicking a menu link we already visited, we would get the same sub-organisation of that page as before - client sided. I know this isn't appropriate in all cases, but for a certain type of web sites, it is more than that. I think it would be a great step. (To get a picture of what kind of site I have in mind, see eg. http://www.metadesign.de, a fabulous site in terms of structure; if you're interested, please note that it says 'English' in the upper right corner.)
if I'm exagerating, just tell me...
DaveSW
09-03-2003, 06:12 AM
javascript forum it is then!
dragle
09-03-2003, 09:02 AM
Instead of using visible as the visibility toggle for your inner divs, use inherit. Then they will take on the visibility attribute of their container divs.
HTH,
Pierre Rouillet
09-03-2003, 09:14 AM
Excellent ! works fine !
Such a simple thing, and so much good comes out of it.
thanks a lot.
For anyone who needs the code, I've posted it at http://www.steffiweismann.de/lager/inaktuell/gogo7.html
dragle
09-03-2003, 09:20 AM
You're welcome!