The Highlight effect is used to call attention to the target element by changing its background color.
Without any options, the background color of the element will change to yellow, and then, throughout the course of the effect duration, morph back into the original background color.
You can use one of the following two forms to use this effect −
new Effect.Highlight('id_of_element', [options]); OR new Effect.Highlight(element, [options]);
This effect has the following parameters in addition to the common parameters.
|Sr.No||Option & Description|
Sets the starting color of the element's background. If omitted, a light yellow color is used.
Sets the ending color of the element's background. If omitted, the original background color of the element is used if it can be determined. Otherwise, the default is white.
Sets the final color of the background after the effect has completed.
This rather jarring use of Highlight changes the background color of the element to red, then morphs that background color to blue over the course of 8 seconds, displaying some interesting shades of purple along the way. After the color morph has been completed, the background color of the element is set to green.
This will produce following result −