Skip to content

A tiny jQuery plugin that Gets as well as Sets CSS Transform properties. Depends upon TweenMax.

Notifications You must be signed in to change notification settings

Luxiyalu/jquery-transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jquery-transformer

Install

Install with:

$ yarn add jquery-transformer

Notice: jquery-transformer depends upon both jQuery AND TweenMax!

API

Usage is similar to jQuery's $('#ele').css():

.transform(propName)

Get the transformation value of certain property.

$('#ele').transform('rotationX') 
// returns 0

.transform(propName, value)

Set the transformation value of certain property.

$('#ele').transform('rotationX', 120) 

// jQuery calls could chain with setter:
$('#ele').transform('rotationX', 120).transform('rotationX') //returns 120

.transform()

Get element's CSS transformation string, equivalent to $('#ele').css('transform').

.transform(false)

Clear all transformation, equivalent to $('#ele').css('transform', 'none').

Properties

This is the list of properties you could get/set, along with their initial values:

perspective: 0
rotation: 0
rotationX: 0
rotationY: 0
scaleX: 1
scaleY: 1
scaleZ: 1
skewX: 0
skewY: 0
x: 0
y: 0
z: 0
zOrigin: 0

About

A tiny jQuery plugin that Gets as well as Sets CSS Transform properties. Depends upon TweenMax.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published