registerEventHandler

[ Function ]

public registerEventHandler(
    name: 'animationstart' | 'animationend' | 'animationiteration',
    callback: (event: TcHmi.Animation.AnimationEvent) => void
): this;

Registers a callback for an animation event.

Parameter

Name

Type

Description

name

string

The name of the event.

'animationstart' is triggered when the animation starts, after the delay has expired.

'animationend' is triggered when the animation ends.

'animationiteration' is triggered when the animation starts in a new repetition.

callback

(event: TcHmi.Animation.AnimationEvent) => void

The function to be called when the event occurs.

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.registerEventHandler('animationstart', (event) => console.log('Animation started: ' + event.animationName));
registerEventHandler 1:

Available from 1.8