Price: $ 19.99
Integration time
Saves you
With this jQuery transform plugin you will be able to:
The elements can be transformed instantly or the transformation can be animated, using the standard jQuery css() and animate() functions:
$('div.test').css( 'transform', 'rotate(10deg)' );
$('div.test').animate({
transform: 'translateX(100px) translateY(50px) scale(2) rotate(90deg)'
});
It is the lightest, cleanest and most efficient plugin to achieve 2d transformation in a cross-browser way.
* no content reflow in modern browsers
jquery.transform2d.js adds 2d transform capabilities to jQuery css() and animate() functions.
$('#myDiv').css('transform', 'translate(50px, 30px) rotate(25deg) scale(2,.5) skew(-35deg)');
$('#myDiv').animate({transform: 'translateY(-100px) rotate(1rad) scaleX(2) skewY(42deg)'});
You can use the following list of transform components:
translateX(<number>px)translateY(<number>px)translate(<number>px, <number>px) the second number is optional and defaults to 0scaleX(<number>)scaleY(<number>)scale(<number>, <number>) the second number is optional and defaults to the value of the first onerotate(<angle>) units for angles are *rad (default), deg or grad.*skew(<angle>)skew(<angle>)skew(<angle>, <angle>) the second angle is optional and defaults to 0matrix(<number>, <number>, <number>, <number>, <number>, <number>)**matrix gives you more control about the resulting transformation, using a matrix construction set.
When using it in animations however, it makes it impossible to predict how the current and target transformations are going to be interpolated; there is no way to tell whether elements are going to rotate clockwise or anti-clockwise for instance.
returns a computed transform matrix.
$('#myDiv').css('transform') == 'matrix(0,1,-1,0,100,50)';
Since translate is unavailable in IE<9, we have to emulate it using top and left properties of the element style.
This can, of course, only work if the elements are absolutely positionned in a relatively positionned wrapper.
Other plugins position the elements and wrap them transparently.
I think that transparently messing with the DOM often introduces unpredictible behavior.
Unpredictible behavior leads developpers to fear plugins.
Fear leads to anger. Anger leads to hate. Hate leads to suffering.
I prefer leaving this up to you.
Dual licensed under GPL and MIT licenses.
Copyright (c) 2010 Louis-Rémi Babé.
Price: $ 19.99
Questions & Comments
Leave a comment
Log-in now or register for a free account.