CSSTranslate()

Experimental

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Draft

This page is not complete.

The CSSTranslate() constructor creates a new CSSTranslate object representing the translate() value of the individual transform property in CSS.

Syntax

var CSSTranslate = new CSSTranslate(x,y[,z]);

Parameters

x
A value for the x-axis of the CSSTranslate object to be constructed. This must be a <length-percentage>.
y
A value for the y-axis of the CSSTranslate object to be constructed. This must be a <length-percentage>.
zOptional
A value for the z-axis of the CSSTranslate object to be constructed. This must be a <length>.

If a value is passed for the z-axis this is a 3d transform. The value of is2D will be set to false.

Exceptions

TypeError
Raised if the value of CSSTranslate.x or CSSTranslate.y is not a <length-percentage>.
TypeError
Raised if the value of CSSTranslate.z exists but is not a <length>.

Examples

To do

Specifications

Specification Status Comment
CSS Typed OM Level 1
The definition of 'CSSTranslate' in that specification.
Working Draft Initial definition.

Browser compatibility

BCD tables only load in the browser