The HoverGradient classes will create an gradient animation when you hover the selected div.

How to Initialize the Hover Gradient?


The initialization of the Hover Gradient is an one step process, just call the function Init of the class with its only arguments (see bellow for more details).


Class Details


Functions:


       Initialization & Main Functions

Name

Arguments

Return

Description

Init

  • String: ID - HMTL ID defining the position in the DOM of the viewer

VOID

This function will set the main members and then relay the initialization to InitEvent.

InitEvent

  • None

VOID

This function will add the Events to the selected div. This function also call the Animation module.



Setters Functions

Name

Arguments

Return

Description

SetDuration

  • Integer: TimeInMS - Duration time of the full animation.

VOID

Setup the animation duration.

SetFirstColor

  • Color: Color - Left Color

VOID

Setup the gradient left color

SetSecondColor

  • Color: Color - Right Color

VOID

Setup the gradient right color

SetSize

  • Integer: Size - Size in % of 50%.

VOID

This function change the transition size on both side (e.g. Size = 10% will be 20%).





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

undefined

Global HMTL Id of the viewer (# + name).

animationInfo

Class:

  • Integer: time
  • String: firstColor
  • String: secondColor
  • size: time
  • String: direction - if animation goes "forward" or "backward".

{

               

//Animation

time: 500,

               

//Color

firstColor: "#000000",        secondColor: "#ffffff",

               

//Size        

size: 10,

               

//Direction

direction: "Forward"

}

Hold all information required by the animation function Animate().

animation

Integer

null

Hold the SetInterval() ID, that can be use to stop the interval.

animationStopedAt

Integer

null

Where the last animation stopped (Percent not X).



Functions:

Animation

Name

Arguments

Return

Description

Animate

  • Integer: Per - percent of the animation.
  • Integer: X - X relative to Per.
  • Class: Ref - Reference to this class

VOID

Function called by Animation module.



Compatibility



LANGUAGE CLASS: Not compatible.

Created with the Personal Edition of HelpNDoc: Easily create Help documents