Forum: Rails Spinoffs (closed, excessive spam) SlideDown with dynamic content

Posted by PAOEGONVG (Guest)
on 2008-06-19 21:59
(Received via mailing list)
I'm using prototype to update the contents of a div, and then it
slides down after the previous div slides up.
The problem is that the height it uses to do the animation doesn't
seem to get updated to match the new content.
I tried using getHeight and SetStyle to do it. But even getHeight
doesn't have the height either.
I guess cause its not being displayed.

Any ideas?
Posted by Matt Foster (Guest)
on 2008-06-20 22:39
(Received via mailing list)
This is because the animation is applying the height directly to the
element in the animation.

Try this,
Effect.SlideUp(element, {
  afterFinish : function(fx){
  fx.element.setStyle({height : "auto"});
}

})


--
Matt Foster
Ajax Engineer
Nth Penguin, LLC
http://www.nthpenguin.com
This topic is locked and can not be replied to.