The Squish effect makes the target element disappear into the upper-left corner of the page. The Squish effect produces the same effect as the Grow effect when the Grow effect’s growCenter option is set to false.
You can only attach this effect to the following HTML elements: address, dd, div, dl, dt, form, img, p, ol, ul, applet, center, dir, menu, or pre.
The following table lists optional available options for the Squish 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. |
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.Squish("targetID",{duration: 2000, from: "100%", to: "0%"}); |
effect.start(); |