web api constructor
CSSTranslate: CSSTranslate() constructor
The CSSTranslate() constructor creates a
new CSSTranslate object representing the translate() value of the
individual transform property in CSS.
Syntax
new CSSTranslate(x, y)
new CSSTranslate(x, y, z)
Parameters
x- : A value for the x-axis of the
CSSTranslateobject to be constructed. This must be alength-percentage.
- : A value for the x-axis of the
y- : A value for the y-axis of the
CSSTranslateobject to be constructed. This must be alength-percentage.
- : A value for the y-axis of the
zOptional-
: A value for the z-axis of the
CSSTranslateobject to be constructed. This must be alength.If a value is passed for the
z-axisthis is a 3d transform. The value ofis2Dwill be set to false.
-
Exceptions
TypeError- : Raised if the value of
CSSTranslate.xorCSSTranslate.yis not alength-percentage.
- : Raised if the value of
TypeError- : Raised if the value of
CSSTranslate.zexists but is not alength.
- : Raised if the value of
Examples
To do
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.