The Move effect changes the target element position within the page. Many of the predefined effects use the Move effect: Grow, Slide, Shake, and Squish.
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 Move effect.
Option |
Description |
---|---|
duration |
Duration of the effect in milliseconds. The default value is 1000. |
toggle |
Lets you create a toggle effect. 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 fromPos = new Spry.Effect.Utils.Position(); fromPos.x = 100; fromPos.y = 100; var toPos = new Spry.Effect.Utils.Position(); toPos.x = 300; toPos.y = 300; Spry.Effect.makePositioned(document.getElementById("targetID")); var size_effect = new Spry.Effect.Move("targetID", fromPos, toPos, {duration: 2000, toggle: true, transition: Spry.fifthTransition});