Animated Gradient create a constantly moving background gradient.


How to Initialize the Animated Gradient ?


The initialization of the flip animation is an one step process, just call the function Init of the class with its one argument (see bellow for more details)

Class Details


Functions:

       Initialization and main functions:

Name

Arguments

Return

Description

Init

  • String: Id - Target DOM ID.

VOID

This function Initialized id member;


Note: EE function: AddGradient() will always Initialize the class before return it.

Launch

  • Integer: Time - Time for the animation to do a complete rotation.
  • FPS: Time - Frame per seconds

VOID


This function will create the Interval loop for the animation by calculating time ratio and shift for each frame, this function can stop prematurely if some condition are not filled.


Important: Make sure you use Setters Functions first.


Stop

NONE

VOID

Call to stop the animation.



Setters functions:

Name

Arguments

Return

Description

AddColor

  • Color: Color - Color to add at position
  • Integer: Position - position of the new color, in percent.

VOID

This function Initialized id member;

SetLastFirstDistance

  • Integer: Distance - Distance in percent

VOID


Used this function to specify the distance between the last color (at 100%) and the first (at 0%).


SetCallback

  • Function: Distance - Distance in percent

VOID

Add callback called at each frames.



Private Details



All private details are usable but its recommended to not use any of those. It might modify the proper functioning of the class.



Variables (Members):



Name

Type

Default Value

Description

id

String

null

Target DOM ID.

colors

Class []:

  • String: col
  • Integer: pos

[]

List of colors and position used by the Update function.

shift

Float

0

Hold the gradient shift animation calculated by the launch function.

LastFirstDist

Integer

50

Distance it take to reach the first color from the last, in %.

Animation

Integer

null

Hold JQuery Interval id, to cancel it when stop function is called.

CallbackFunc

Function

null

Hold the callback function called each frame.



Functions:



Name

Arguments

Return

Description

Update

  • None

None

This function will increment and update the gradient.




Compatibility



LANGUAGE CLASS:  Not compatible.

Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web sites