Flip


The flip is simple way to flip an item, it create dynamically every block that is needed to work


Note: this class use animations functions: make sure you called the module part: Functional Animation before use it.


How to Initialize the Flip ?


The initialization of the flip animation is an one step process, just call the function Init of the class with his three arguments (see above for more details)

Class Details


Functions:


Name

Arguments

Return

Description

Init

  • String: Id - HMTL ID defining the position in the DOM of the viewer
  • String: Name - Define the name of the flip all flip component will be defined by this name (this is to avoid mix if you use different flip so be sure to use different name for each flip).
  • Integer : Speed - Flipping animation time in MS.

VOID

This function Initialized every part of the flip: HMTL and the base CSS. It will generate in the defined ID as ID and all HTML IDs used for this timeline will start by the name defined in arguments

AddData

  • State: To - Define which side you want to add data (None is not valid)
  • String: Data - New HTML Data to add to the side.

VOID

Call this function to add new data in one of the two sides.

ChangeCSS

  • State: To - Define which side you want to add data ( Call None to change the CSS of the main block).
  • Class: CSS - CSS to add or modify

VOID

Call this function to change the CSS of the flip.

ChangeChildrenCSS

  • State: To - Define which side you want to add data ( Call None to change the CSS of the main block).
  • String: ChildrenID - Id of the children to modify his CSS
  • Class: CSS - CSS to add or modify

VOID

Is functions is used to modify the CSS of children in the sides.

flip

  • State: To (Optional) - Define which side you want to go

VOID

This function is used to process the flipping animation, you can either define the side to go or just call the function without arguments and it will switch state


Note: that you can't go back to state: NONE.



Enumerations:


Name

List

Description

modulesList

  • NONE
  • FRONT
  • BACK

This is the different flipping sides.



Private Details



/!\/!\/!\/!\ All private details are usable but its recommended to not use anythings of those. It might modify the good working of the class. /!\/!\/!\/!\



Variables (Members):


Name

Type

Default Value

Description

basedId

String

null

HTML Id of the viewer parent.

id

String

null

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

name

String

null

Name of the viewer used by the class for all HTML IDs

animationSpeed

Integer

null

Define the flipping animation speed

activeSide

State

NONE

Hold the active side of the flipping



Functions:


Name

Arguments

Return

Description

FlipAnimation (Animation Function)

  • Integer: Percent - Advancement of the animation
  • Integer: X - X based on the advancement
  • Class: data - Data that the function need

None

This function is called to update the flipping animation.

GetFrontID

  • None

String - HTML ID of the Front div

Function used to get the HTML ID of the front div (used to short the code).

GetBackID

  • None

String - HTML ID of the Back div

Function used to get the HTML ID of the back div (used to short the code).

Created with the Personal Edition of HelpNDoc: Full-featured EPub generator