Note: This feature is available in Web Workers.
The CSSRotate() constructor creates a new CSSRotate object representing the rotate() value of the individual transform property in CSS.
This can be specified as either a 2D rotation by a particular angle, or as a 3D rotation by an angle around a particular axis.
new CSSRotate(angle)
new CSSRotate(x, y, z, angle)angleA value for the angle of the CSSRotate object to be constructed. This must be a CSSNumericValue.
x OptionalA value for the x-axis of the CSSRotate object to be constructed. This must either be a number (which is wrapped into a CSSUnitValue of unit: "number") or a CSSNumericValue. Only used, and required, when constructing a 3D rotation.
y OptionalA value for the y-axis of the CSSRotate object to be constructed. This must either be a number (which is wrapped into a CSSUnitValue of unit: "number") or a CSSNumericValue. Only used, and required, when constructing a 3D rotation.
z OptionalA value for the z-axis of the CSSRotate object to be constructed. This must either be a number (which is wrapped into a CSSUnitValue of unit: "number") or a CSSNumericValue. Only used, and required, when constructing a 3D rotation.
TypeErrorRaised if the value of CSSRotate.angle is not an <angle> value or CSSRotate.x, CSSRotate.y, CSSRotate.z are not <number> values.
To do