The Size effect changes the target element’s width and height. Many of the clustered effects use the Size effect: Grow, Blind, Slide.
You can only attach this effect to the following HTML elements: address, dd, div, dl, dt, form, img, ol, ul, applet, center, dir, menu, or pre.
The following table lists available options for the Size effect.
Option |
Description |
---|---|
duration |
Duration of the effect in milliseconds. The default value is 1000. |
scaleContent |
Scales the content of the element proportionally with the dimensions of the animation. The default value is false. |
toggle |
Lets you create a toggle effect. The default value is false. |
useCSSBox |
Modifies the border, margin and padding proportionally to the element’s inner content box. The default value is false. |
transition |
Determines the type of transition. The default is Spry.sinusoidalTransition. |
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 fromRect = new Spry.Effect.Utils.Rectangle(); fromRect.width = 100; fromRect.height = 100; var toRect = new Spry.Effect.Utils.Rectangle(); toRect.width = 300; toRect.height = 300; Spry.Effect.makeClipping(document.getElementById("targetID")); var size_effect = new Spry.Effect.Size("targetID", fromRect, toRect, {duration: 2000, toggle: true, scaleContent: true, transition: Spry.fifthTransition});