I'm not sure if there's a canonical use case (pre-rendered gadgets? gadgets whose "stable" size is desired before displaying on-screen? Paul, are you able to say what your use case is?), but this class of behavior seems fairly general to me. I'd be interested in seeing something, maybe as a code example that could potentially be folded into container code later. --John
On Wed, Jul 29, 2009 at 4:40 AM, Arne Roomann-Kurrik <[email protected]>wrote: > *Is there a common use case for this functionality? I could do a proof of > concept of what I described if anyone is truly interested...* > *~Arne* > * > * > On Tue, Jul 28, 2009 at 2:17 PM, John Hjelmstad <[email protected]> wrote: > > > Yeah, this has been a problem for quite some time. As best I can tell, > > there's nothing you can do about it (re: auto-detection anyway). I > suppose > > we could bake this (off-screen or visibility:hidden) logic into common > > container management JS for gadgets using dynamic-height. > > --John > > > > On Tue, Jul 28, 2009 at 2:14 PM, Paul Lindner <[email protected]> wrote: > > > > > Ugh. I think I'll stick with offscreen placement. In any case for the > > > archives adjustHeight() fails with display:none in some browsers > because > > > the > > > JS code asks for the rendered size and modern browser don't bother to > > > render > > > because the content is not displayed... > > > > > > On Tue, Jul 28, 2009 at 7:21 AM, Arne Roomann-Kurrik < > [email protected] > > > >wrote: > > > > > > > Hi Paul, > > > > > > > > Have you tried using visibility:hidden? It should preserve the > div's > > > > dimensions and position in the page, but not render anything, so > > > > adjustHeight should still be calculated correctly. > > > > > > > > If you need to remove the hidden div from it's position in the dom, > > you > > > > could try positioning it absolutely and with a z-index below another > > > > explicitly positioned item in the page, like a big display:relative > > > > background div, although that's a bit of an ugly solution as well. > > > > > > > > Another approach might be to render the enclosing div as > > > overflow:hidden, > > > > visibility:hidden, and 1px high and 1px wide, but I don't know what > the > > > > behavior of adjustHeight will be in that case. > > > > > > > > ~Arne > > > > > > > > > > > > On Tue, Jul 28, 2009 at 7:04 AM, Paul Lindner <[email protected] > > > > > > wrote: > > > > > > > > > Hi, > > > > > I have a situation where I'd like to calculate render a gadget but > > not > > > > > display it immediately. I set the css class display:none on a div > > > > > surrounding the iframe. To display the gadget I remove that style. > > So > > > > far > > > > > so good. However I've noticed that in Firefox (and perhaps other > > > places > > > > > too) that dynamic-height will always return height 0 in this case. > > As > > > a > > > > > workaround I've moved the divs offscreen with absolute positioning, > > but > > > > > that > > > > > seems somewhat ugly. > > > > > > > > > > > > > > >

