Browse files

Mainly a fix for Firefox 16, but... $(el).transform() fetches style s…

…tring for current transform, which in some browsers is a matrix() statement instead of a set of separate trans

form functions.  This made it so I couldn't simply grep for skewY().  I was already tracking the current degrees of animation via $(el).data() anyway... so now I just return that rather than parsing from style string.  In future would be good to actually support transforms already set on an element by other code/CSS.
  • Loading branch information...
1 parent 4b57c22 commit a8663904bd8c4ee9b8d1eaac2e56325ccafa2784 @zachstronaut committed Oct 4, 2012
Showing with 6 additions and 12 deletions.
  1. +2 −0 README.md
  2. +4 −12 rotate3Di.js
View
2 README.md
@@ -36,6 +36,8 @@ This code is currently available for use in all personal or commercial projects
## Change Log
+2012.10.04 - v0.9.2: Mainly a fix for Firefox 16, but... $(el).transform() fetches style string for current transform, which in some browsers is a matrix() statement instead of a set of separate transform functions. This made it so I couldn't simply grep for skewY(). I was already tracking the current degrees of animation via $(el).data() anyway... so now I just return that rather than parsing from style string. In future would be good to actually support transforms already set on an element by other code/CSS.
+
2012.07.24 - v0.9.1: Firefox 14 / W3C transforms change... skew() replaced with skewY()
2010.11.26 - Added to GitHub, including updated dependencies to enabled IE9 (Platform Preview 7+) support
View
16 rotate3Di.js
@@ -1,10 +1,10 @@
(function ($) {
- // rotate3Di v0.9.1
+ // rotate3Di v0.9.2
// https://github.com/zachstronaut/rotate3Di
- // 2012.07.24 - 2009.03.11 Zachary Johnson http://www.zachstronaut.com
+ // 2012.10.04 - 2009.03.11 Zachary Johnson http://www.zachstronaut.com
// "3D" isometric rotation and animation using CSS3 transformations
// currently supported in Safari/Chrome/Webkit, Firefox 3.5+, IE 9+,
- // and Opera 11+. Tested with jQuery 1.3.x through 1.6.
+ // and Opera 11+. Tested with jQuery 1.3.x through 1.7.2.
var calcRotate3Di = {
@@ -74,15 +74,7 @@
var proxied = $.fx.prototype.cur;
$.fx.prototype.cur = function () {
if(this.prop == 'rotate3Di') {
- var style = $(this.elem).css('transform');
- if (style) {
- var m = style.match(/skewY\((-?[0-9]+)deg\)/);
- if (m && m[1]) {
- return parseInt(m[1]);
- } else {
- return 0;
- }
- }
+ return $(this.elem).data('rotate3Di.degrees') || 0;
}
return proxied.apply(this, arguments);

0 comments on commit a866390

Please sign in to comment.