Search code examples
javascriptdomuser-interfacescriptaculous

Scriptaculous Effect.Grow() start from set size, not 0


I have a div that appears if errors were encountered during a processing step. I have a 'More Info' link which, when clicked, I would like to expand and show specific errors encountered.

I thought I could use scriptaculous and the Effect.Grow() animation but this seems to always start from 0px x 0px and scale up.

Is it possible to start from the existing dimensions of my div and grow from there?


Solution

  • Effect.Grow doesn't provide any start-size parameter indeed and always starts from the 0. So you probably would want to reconsider the use of Grow and choose something else.

    I would suggest Effect.Morph for the job - you may achieve the same kind of effect with a lot less hassle.