The Fade effect makes an element appear or fade away.
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 Fade effect.
Option |
Description |
---|---|
duration |
Duration of the effect in milliseconds. The default value is 1000. |
from |
Start opacity value in %. The default value is 0. |
to |
End opacity value in %. The default value is 100. |
toggle |
Lets you create a toggle effect. The default value is false. |
transition |
Determines the type of transition. The default is Spry.fifthTransition. |
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.Fade('targetID', {duration: 2000, from: 0, to: 100, toggle: true}); |
effect.start(); |