Skip to content

Transformer.js

dannyx0 edited this page Aug 12, 2012 · 4 revisions

Transformer.js is a lot like jQuery.css(), except it's dedicated to CSS transform and transformOrigin. It's easier than jQuery.css() because it's automatically prefixed and allows for an infinite combination of transformations.

Quick Start

HTML

<div id="box"></div>

JavaScript

require(["Transformer"], function (tr) {

	var box = document.getElementById('box');

	tr.transform(box, {
		translateX : '10px',
		rotateY : '45deg',
		translateZ : '-40px'
	});

});

Clone this wiki locally