The Opacity effect makes the target element disappear or appear by changing the CSS opacity property. The Fade effect uses the Opacity effect.
You can attach the Fade effect to any HTML element except applet, body, iframe, object, tr, tbody, or th.
The following table lists available options for the Opacity 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 effect = new Spry.Effect.Opacity("targetID", 1, 0.5, {duration: 2000, toggle: true}); |
effect.start(); |