The Highlight effect changes the background color of a target element.
You can attach the Highlight effect to any HTML element except applet, body, frame, frameset, or noframes.
The following table lists the available options for the Highlight effect.
Option |
Description |
---|---|
duration |
Duration of the effect in milliseconds. The default value is 1000. |
from |
Start color value in RGB color format (#RGB). This value sets the color of the first frame of the highlight. The default is the current background color of the target element. |
to |
End color value in RGB color format (#RGB). This value sets the color of the last frame of the highlight. |
restoreColor |
Color value in RGB color format (#RRGGBB or #RGB) that’s restored at the end of the effect. |
toggle |
Lets you create a toggle effect. The default value is false. If the value is set to true, the restoreColor option is ignored. |
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.Highlight('targetID', {duration:1000, from:"#00ff00", to:"#0000ff"}); |
effect.start(); |