The Color effect creates the transition of the target element background from one color to another. The Highlight effect uses this effect to highlight an element.
You can attach the Color effect to any HTML element except applet, body, frame, frameset, or noframes.
The following table lists available options for the Color 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.Color("targetID", "#FFCC33", "#CC5512", {duration: 2000, transition: Spry.fifthTransition, toggle: true}); |
effect.start(); |