Re: height to: auto?
- Yeah, I knew that - just wanted to make sure you did not have something else in mind.
Turns out that I needed to change the visibility to hidden for the clone AND append it to
the body in order to get the offsetHeight. I had seen another script that was able to get
height without appending to the body though - go figure. BTW, composing text using
Safari here is awful - it keeps autoscrolling below what I am typing.
> visibility:hidden is your best bet. You can't measure the offset height if
> it's display:none.
> Steven Peterson
> Web Developer, Platform Engineering
> On Behalf Of green_jimmy_sm
> Sent: Wednesday, June 28, 2006 2:35 PM
> Invisible as in visibility hidden, display none, or opacity 0 ? :)
> > In my experience, the best way to do this is to set the div to invisible
> > its auto height, and use offsetHeight to calculate the end point for the
> > animation. I know this sounds like what you've done via clone, but perhaps
> > you should try doing it without cloning first to see if the cloning
> > is where the issue is occurring. I've been able to successfully do this in
> > the past, so I think the invisible approach should work for you. Let me
> > if you manage to get it worked out, and if not, perhaps you can post a
> > sample to the group so that we can take a look at it.
> > Steven Peterson
> > Web Developer, Platform Engineering
> > Yahoo!
> > On Behalf Of green_jimmy_sm
> > Sent: Wednesday, June 28, 2006 10:09 AM
> > So I have a div that I want to grow to it's auto height starting from
> > a height of 0px. But for the life of me I can't get it to work. Using
> > "auto" causes an error, so I tried to clone the object - set the
> > cloned height to auto - then use the cloned offsetHeight, and that did
> > not work. I don't want to use a fixed height, so that is out of the
> > question. There has to be a way to do this, moo.fx and prototype pull
> > it off - what am I not doing?