The Grow effect increases or reduces the size of the element. The default movement is toward or away from the center of the element.
You can only attach this effect to the following HTML objects: address, dd, div, dl, dt, form, p, ol, ul, applet, center, dir, menu, img or pre.
The following table lists available options for the Grow effect.
Option |
Description |
---|---|
duration |
Duration of the effect in milliseconds. The default value is 1000. |
from |
Start size in % or pixels. The default value is 0%. |
to |
End size in % or pixels. The default value is 100%. |
toggle |
Lets you create a toggle effect. The default value is false. |
growCenter |
Growing and shrinking direction of the element. The default value is true (grow and shrink from center). If set to false, the element grows or shrinks from the top left corner. |
useCSSBox |
Modifies the border, margin and padding proportionally to the element’s inner content box. Default value is false. |
transition |
Determines the type of transition. The default is Spry.squareTransition. |
fps |
Determines the number of frames per second (fps) of the animation. The default is 60. |
setup |
Lets you define a function that is called before the effect begins, e.g., setup:function (element,effect){/* ... */}. |
finish |
Lets you define a function that is called after the effect finishes, e.g., finish:function (element,effect){/* ... */}. |
Sample code:
var effect = new Spry.Effect.Grow("targetID", {duration: 2000, from: "0%", to: "100%"}); |
effect.start(); |