css-transformer
v0.0.2
Published
css3 transform tool
Downloads
6
Readme
css-transformer
JavaScript library tool to hanlde css3 transform property.
Install
$ npm install css-transformer
How to use
<div id="my-element" style="transform: translate(100px) rotate(20deg);">
Nice transform!
</div>
var transform = require('css-transfomer');
var el = document.getElementById('my-element');
// get current transform properties from the given element
var prps = transform(el);
// set translate property
prps.translate(200);
transform(el, prps);
<div id="my-element" style="transform: translate(200px) rotate(20deg);">
Nice transform!
</div>
API
Transform(Element)
Return the transform
properties object from the given element
Transform.build(Object)
Return the transform
style string from the given transform object
Transform.set(Element, Object)
Set transform
property in the given element from the given transform object
License
MIT – Copyright 2014 Automattic