addKeyframe

[ Function ]

public addKeyframe(styles: Dictionary<string | string[]>, progressPoint: number): this;

Adds a keyframe.

Parameter

Name

Type

Description

styles

Dictionary<string | string[]>

A collection of CSS properties and their desired values.

progressPoint

number

A value between 0 and 1 inclusive, which determines the point in time of the animation. 0 is the start and 1 the end of the animation.

Return value

Type

Description

TcHmi.Animation

This method returns its parent object to allow concatenation of method calls.

Sample - JavaScript

var animation = new TcHmi.Animation('ViewDesktopBeckhoffLogo', '');
animation.addKeyframe({ top: '20px', left: '20px' }, 0)
    .addKeyframe({ top: '50px', left: '50px' }, 1);
addKeyframe 1:

Available from 1.8