The Slide effect moves the target element up or down (or left to right). This effect is similar to the Blind effect, but the contents move up and down (or left to right) instead of staying in the same place.
You can only attach this effect to the following HTML elements: blockquote, dd, div, form, center, table, span, input, textarea, select, or image.
The following table lists available options for the Slide effect.
Option |
Description |
---|---|
duration |
Duration of the effect in milliseconds. The default value is 2000. |
from |
Start size in % or pixels. The default value is 100% of the element’s original size. |
to |
End size in % or pixels. The default value is 0 of the element’s original size. |
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. |
horizontal |
If set to true, slides the content horizontally instead of vertically. The default value is false. |
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.Slide("targetID", {duration: 2000, from: '100%', to: '0%'}); |
effect.start(); |