Contents

WebKitCSSMatrix

WebKitCSSMatrix objects represent a 4x4 homogeneous matrix for 3D transforms or a vector for 2D transforms. You can use these objects to manipulate matrices in JavaScript. For example, you can multiply, translate, and scale matrices.

Declaration

interface WebKitCSSMatrix

Overview

The values of a 3D matrix can be initialized from the matrix3d transform function returned by window.getComputedStyle(element).webkitTransform(). To apply the final matrix to an element, construct a string using the matrix3d transform function passing the 16 values, and assign it to element.style.webkitTransform. Similarly, you can construct a matrix for 2D transforms by setting 6 values, represented by the a-f properties.

Topics

Accessing Properties

Setting the Matrix

Applying Operations

Converting the Matrix