Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for *skew*. #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $("#box").css({ translate: [60,30] }); // Move right and down
$("#box").css({ rotate: '30deg' }); // Rotate clockwise
$("#box").css({ scale: 2 }); // Scale up 2x (200%)
$("#box").css({ scale: [2, 1.5] }); // Scale horiz and vertical
$("#box").css({ skew: '45deg, 45deg' }); // Skew in both directions at the same time
$("#box").css({ skewX: '30deg' }); // Skew horizontally
$("#box").css({ skewY: '30deg' }); // Skew vertical
$("#box").css({ perspective: 100, rotateX: 30 }); // Webkit 3d rotation
Expand Down
6 changes: 6 additions & 0 deletions jquery.transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
registerCssHook('rotateY');
registerCssHook('rotate3d');
registerCssHook('perspective');
registerCssHook('skew');
registerCssHook('skewX');
registerCssHook('skewY');
registerCssHook('x', true);
Expand Down Expand Up @@ -343,6 +344,11 @@
this.scale = x + "," + y;
},

// ### skew
skew: function(x, y) {
this.skew = unit(x, 'deg') + "," + unit(y, 'deg');
},

// ### skewX + skewY
skewX: function(x) {
this.skewX = unit(x, 'deg');
Expand Down