timingFunction

[ Function ]

public timingFunction(valueNew: string | ((t: number) => number) | null): this;

Sets the timing function of the animation.

Parameter

Name

Type

Description

valueNew

string, (t: number) => number, null

The timing function of the animation. If null is passed, the default value 'ease' is used.

The timing function can be either a string that represents a valid value for the CSS animation-timing-function property, or a function that accepts a number between 0 and 1 and returns a number. If a JavaScript function is passed, the animation cannot be played via CSS.

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', '');
var timingDefault = animation.timingFunction(); // 'ease'
animation.timingFunction('cubic-bezier(0.1, -0.6, 0.2, 0)');
var timing = animation.timingFunction(); // 'cubic-bezier(0.1, -0.6, 0.2, 0)'
timingFunction 1:

Available from 1.8