- From: Andrew Fedoniouk <news@terrainformatica.com>
- Date: Thu, 14 Feb 2008 23:11:02 -0800
- To: Andrew Fedoniouk <news@terrainformatica.com>, fantasai <fantasai.lists@inkedblade.net>, www-style@w3.org
L. David Baron wrote: > On Thursday 2008-02-14 09:23 -0800, Andrew Fedoniouk wrote: >> Dynamic show/hide of elements. Used in many circumstances in scripts and in >> static CSS declarations. > > In what cases would this proposed feature be needed where > display:none is not sufficient? display:none makes the element completely invisible for layout (placement calculation) algorithm. In cases like this: http://blogs.grf-design.com/060405/ visibility:collapsed is highly desirable for computation of panels inside this "accordion". visibility:collapsed here is close to combination of following: overflow:hidden; height:0; min-width: min-intrinsic; > >> body[mode="bar"] .dependent >> { >> display: ???; /* what to put here to show arbitrary element so to discard >> display:none? */ >> } > > Put nothing at all; the rule with display:none doesn't match > anymore. Generally true but not so convenient. > >> var el = ...; >> el.style.display = "none"; // to hide >> el.style.display = "????"; // how exactly to define "show" ? > > I use el.style.display="" quite often and it works fine for this. > That would work if this element has computed value of @display other than "none". If such element was initially defined as display:none then el.style.display="" will lead to display:none. OT: I think that el.style.display = null; is better to express intention of clearing local value of style attribute. I am not sure but empty string should not be a valid value of display attribute. -- Andrew Fedoniouk. http://terrainformatica.com
Received on Friday, 15 February 2008 07:11:06 UTC