Permalink
Browse files

Fully supporting units in animate. Some issues with IE8 and below for…

… exotic units on Origin.
  • Loading branch information...
1 parent d3ad13f commit a7ffd6c0da0d1a6efcb07cb3fa9df8fc3b4f458f @heygrady committed Nov 14, 2010
View
51 dist/jquery.transform-0.9.0pre.js
@@ -6,7 +6,7 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: Sun Oct 24 23:27:27 2010 -0700
+ * Date: Sun Nov 7 23:14:31 2010 -0800
*/
///////////////////////////////////////////////////////
// Transform
@@ -800,7 +800,7 @@
$.each( prop, function( name, val ) {
if ($.cssMultipleValues[name]
|| $.cssAngle[name]
- || (!$.cssNumber[name] && $.transform.funcs[name])) {
+ || (!$.cssNumber[name] && $.inArray(name, $.transform.funcs))) {
// force the original values onto the optall
optall.original[name] = val.toString();
@@ -829,10 +829,15 @@
$.fx.prototype.custom = function(from, to, unit) {
var multiple = $.cssMultipleValues[this.prop],
angle = $.cssAngle[this.prop];
-
- if (multiple) {
+
+ //TODO: simply check for the existence of CSS Hooks?
+ if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs))) {
this.values = [];
+ if (!multiple) {
+ multiple = 1;
+ }
+
// Pull out the known values
var values = this.options.original[this.prop],
currentValues = $(this.elem).css(this.prop),
@@ -924,42 +929,6 @@
unit: unit
});
});
- } else if (angle) {
- var val = this.options.original[this.prop],
- currentVal = $(this.elem).css(this.prop),
- defaultVal = $.cssDefault[this.prop] || 0,
- fx = this;
-
- // normalize start on degrees
- from = fx.start = $.angle.toDegree(currentVal || defaultVal);
-
- // normalize end on degrees
- to = fx.end = $.angle.toDegree(val);
-
- //change units to degrees
- unit = fx.unit = 'deg';
- } else if (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs)) {
- var currentVal = $(this.elem).css(this.prop),
- defaultVal = $.cssDefault[this.prop] || 0,
- parts, start, fx = this,
- orig = $.style(fx.elem, prop);
-
- // normalize start to pixels
- start = currentVal || defaultVal;
- parts = rfxnum.exec(start);
- if (parts && parts[3]) {
- $.style( fx.elem, prop, start);
- start = cur(fx.elem, prop);
- $.style( fx.elem, prop, orig);
- }
-
- // convert the start units to the end units
- if (unit !== 'px') {
- $.style( fx.elem, prop, (to || 1) + unit);
- start = ((to || 1) / cur(fx.elem, prop)) * start;
- $.style( fx.elem, prop, orig);
- }
- from = fx.start = start;
}
return _custom.apply(this, arguments);
};
@@ -985,7 +954,7 @@
var transform = fx.elem.transform || new $.transform(fx.elem),
funcs = {};
- if ($.cssMultipleValues[func]) {
+ if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs))) {
($.fx.multipleValueStep[fx.prop] || $.fx.multipleValueStep._default)(fx);
funcs[fx.prop] = [];
$.each(fx.values, function(i, val) {
View
4 dist/jquery.transform-0.9.0pre.min.js
@@ -6,6 +6,6 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: Sun Oct 24 23:27:27 2010 -0700
+ * Date: Sun Nov 7 23:14:31 2010 -0800
*/
-(function(f,g,j,c){var h=/progid:DXImageTransform\.Microsoft\.Matrix\(.*?\)/;var d=j.createElement("modernizr"),e=d.style;function n(m){return parseFloat(m)}function l(){var m={transformProperty:"",MozTransform:"-moz-",WebkitTransform:"-webkit-",OTransform:"-o-",msTransform:"-ms-"};for(var r in m){if(typeof e[r]!="undefined"){return m[r]}}return null}function q(){if(typeof(g.Modernizr)!=="undefined"){return Modernizr.csstransforms}var r=["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"];for(var m in r){if(e[r[m]]!==c){return true}}}var a=l(),i=a!==null?a+"transform":false,k=a!==null?a+"transform-origin":false;f.support.csstransforms=q();if(a=="-ms-"){i="msTransform";k="msTransformOrigin"}f.extend({transform:function(m){m.transform=this;this.$elem=f(m);this.applyingMatrix=false;this.matrix=null;this.height=null;this.width=null;this.outerHeight=null;this.outerWidth=null;this.boxSizingValue=null;this.boxSizingProperty=null;this.attr=null;this.transformProperty=i;this.transformOriginProperty=k}});f.extend(f.transform,{funcs:["matrix","origin","reflect","reflectX","reflectXY","reflectY","rotate","scale","scaleX","scaleY","skew","skewX","skewY","translate","translateX","translateY"],rfunc:{angle:/^rotate|skew[X|Y]?$/,length:/^origin|translate[X|Y]?$/,scale:/^scale[X|Y]?$/,reflect:/^reflect(XY|X|Y)?$/}});f.fn.transform=function(m,r){return this.each(function(){var s=this.transform||new f.transform(this);if(m){s.exec(m,r)}})};f.transform.prototype={exec:function(m,r){r=f.extend(true,{forceMatrix:false,preserve:false},r);this.attr=null;if(r.preserve){m=f.extend(true,this.getAttrs(true,true),m)}else{m=f.extend(true,{},m)}this.setAttrs(m);if(f.support.csstransforms&&!r.forceMatrix){return this.execFuncs(m)}else{if(f.browser.msie||(f.support.csstransforms&&r.forceMatrix)){return this.execMatrix(m)}}return false},execFuncs:function(r){var m=[];for(var s in r){if(s=="origin"){this[s].apply(this,f.isArray(r[s])?r[s]:[r[s]])}else{if(f.inArray(s,f.transform.funcs)!=-1){m.push(this.createTransformFunc(s,r[s]))}}}this.$elem.css(i,m.join(" "));return true},execMatrix:function(t){var F,A,C;var v=this.$elem[0];function s(H){return o(v,H)}for(var w in t){if(f.matrix[w]){switch(f.type(t[w])){case"array":C=t[w];break;case"string":C=f.map(t[w].split(","),f.trim);break;default:C=[t[w]]}if(f.cssAngle[w]){C=f.map(C,f.angle.toDegree)}else{if(!f.cssNumber[w]){C=f.map(C,s)}else{C=f.map(C,n)}}A=f.matrix[w].apply(this,C);F=F?F.x(A):A}else{if(w=="origin"){C=f.isArray(t[w])?t[w]:[t[w]];this[w].apply(this,C)}}}F=F||f.matrix.identity();var G=parseFloat(F.e(1,1).toFixed(6)),E=parseFloat(F.e(2,1).toFixed(6)),D=parseFloat(F.e(1,2).toFixed(6)),B=parseFloat(F.e(2,2).toFixed(6)),y=F.rows===3?parseFloat(F.e(1,3).toFixed(6)):0,x=F.rows===3?parseFloat(F.e(2,3).toFixed(6)):0;if(f.support.csstransforms&&a==="-moz-"){this.$elem.css(i,"matrix("+G+", "+E+", "+D+", "+B+", "+y+"px, "+x+"px)")}else{if(f.support.csstransforms){this.$elem.css(i,"matrix("+G+", "+E+", "+D+", "+B+", "+y+", "+x+")")}else{if(f.browser.msie){var m=", FilterType='nearest neighbor'";var r=this.$elem[0].style;var z="progid:DXImageTransform.Microsoft.Matrix(M11="+G+", M12="+D+", M21="+E+", M22="+B+", sizingMethod='auto expand'"+m+")";var u=r.filter||f.curCSS(this.$elem[0],"filter")||"";r.filter=h.test(u)?u.replace(h,z):u?u+" "+z:z;this.applyingMatrix=true;this.matrix=F;this.fixPosition(F,y,x);this.applyingMatrix=false;this.matrix=null}}}return true},origin:function(m,r){if(f.support.csstransforms){if(typeof r==="undefined"){this.$elem.css(k,m)}else{this.$elem.css(k,m+" "+r)}return true}switch(m){case"left":m="0";break;case"right":m="100%";break;case"center":case c:m="50%"}switch(r){case"top":r="0";break;case"bottom":r="100%";break;case"center":case c:r="50%"}if(/%/.test(m)&&/%/.test(r)){this.setAttr("origin",[m,r]);return true}this.setAttr("origin",[/%/.test(m)?m:parseFloat(m)+"px",/%/.test(r)?r:parseFloat(r)+"px"]);return true},createTransformFunc:function(s,t){if(s.substr(0,7)==="reflect"){var r=t?f.matrix[s]():f.matrix.identity();return"matrix("+r.e(1,1)+", "+r.e(2,1)+", "+r.e(1,2)+", "+r.e(2,2)+", 0, 0)"}if(s=="matrix"){if(a==="-moz-"&&t[4]){t[4]=t[4]?t[4]+"px":0;t[5]=t[5]?t[5]+"px":0}}return s+"("+(f.isArray(t)?t.join(", "):t)+")"},fixPosition:function(z,w,v,B,m){var u=new f.matrix.calc(z,this.safeOuterHeight(),this.safeOuterWidth()),A=this.getAttr("origin");var t=u.originOffset(new f.matrix.V2(/%/.test(A[0])?parseFloat(A[0])/100*u.outerWidth:parseFloat(A[0]),/%/.test(A[1])?parseFloat(A[1])/100*u.outerHeight:parseFloat(A[1])));var r=u.sides();var s=this.$elem.css("position");if(s=="static"){s="relative"}var y={top:0,left:0};var x={position:s,top:(t.top+v+r.top+y.top)+"px",left:(t.left+w+r.left+y.left)+"px",zoom:1};this.$elem.css(x)}};var b=/^([\+\-]=)?([\d+.\-]+)(.*)$/;function o(m,s){var r=b.exec(f.trim(s)),u="paddingBottom",t=f.style(m,u);if(r[3]){f.style(m,u,s);s=p(m,u);f.style(m,u,t);return s}return parseFloat(s)}function p(s,t){if(s[t]!=null&&(!s.style||s.style[t]==null)){return s[t]}var m=parseFloat(f.css(s,t));return m&&m>-10000?m:0}})(jQuery,this,this.document);(function(d,c,a,f){d.extend(d.transform.prototype,{safeOuterHeight:function(){return this.safeOuterLength("height")},safeOuterWidth:function(){return this.safeOuterLength("width")},safeOuterLength:function(l){var o="outer"+(l=="width"?"Width":"Height");if(d.browser.msie){l=l=="width"?"width":"height";if(this.applyingMatrix&&!this[o]&&this.matrix){var k=new d.matrix.calc(this.matrix,1,1),m=k.offset(),g=this.$elem[o]()/m[l];this[o]=g;return g}else{if(this.applyingMatrix&&this[o]){return this[o]}}var n={height:["top","bottom"],width:["left","right"]};var h=this.$elem[0],j=parseFloat(d.curCSS(h,l,true)),p=this.boxSizingProperty,i=this.boxSizingValue;if(!this.boxSizingProperty){p=this.boxSizingProperty=e()||"box-sizing";i=this.boxSizingValue=this.$elem.css(p)||"content-box"}if(this[o]&&this[l]==j){return this[o]}else{this[l]=j}if(p&&(i=="padding-box"||i=="content-box")){j+=parseFloat(d.curCSS(h,"padding-"+n[l][0],true))||0+parseFloat(d.curCSS(h,"padding-"+n[l][1],true))||0}if(p&&i=="content-box"){j+=parseFloat(d.curCSS(h,"border-"+n[l][0]+"-width",true))||0+parseFloat(d.curCSS(h,"border-"+n[l][1]+"-width",true))||0}this[o]=j;return j}return this.$elem[o]()}});var b=null;function e(){if(b){return b}var h={boxSizing:"box-sizing",MozBoxSizing:"-moz-box-sizing",WebkitBoxSizing:"-webkit-box-sizing",OBoxSizing:"-o-box-sizing"},g=a.body;for(var i in h){if(typeof g.style[i]!="undefined"){b=h[i];return b}}return null}})(jQuery,this,this.document);(function(g,f,b,h){var d=/([\w\-]*?)\((.*?)\)/g,a="data-transform",e=/\s/,c=/,\s?/;g.extend(g.transform.prototype,{setAttrs:function(i){var j="",l;for(var k in i){l=i[k];if(g.isArray(l)){l=l.join(", ")}j+=" "+k+"("+l+")"}this.attr=g.trim(j);this.$elem.attr(a,this.attr)},setAttr:function(k,l){if(g.isArray(l)){l=l.join(", ")}var j=this.attr||this.$elem.attr(a);if(!j||j.indexOf(k)>-1){this.attr=g.trim(j+" "+k+"("+l+")");this.$elem.attr(a,this.attr)}else{var i=[],m;d.lastIndex=0;while((result=d.exec(j))!==null){if(k==m[1]){i.push(k+"("+l+")")}else{i.push(m[0])}}this.attr=i.join(" ");this.$elem.attr(a,this.attr)}},getAttrs:function(){var j=this.attr||this.$elem.attr(a);if(!j){return{}}var i={},l,k;d.lastIndex=0;while((l=d.exec(j))!==null){if(l){k=l[2].split(c);i[l[1]]=k.length==1?k[0]:k}}return i},getAttr:function(j){var i=this.getAttrs();if(typeof i[j]!=="undefined"){return i[j]}if(j==="origin"&&g.support.csstransforms){return this.$elem.css(this.transformOriginProperty).split(e)}else{if(j==="origin"){return["50%","50%"]}}return g.cssDefault[j]||0}});if(typeof(g.cssAngle)=="undefined"){g.cssAngle={}}g.extend(g.cssAngle,{rotate:true,skew:true,skewX:true,skewY:true});if(typeof(g.cssDefault)=="undefined"){g.cssDefault={}}g.extend(g.cssDefault,{scale:[1,1],scaleX:1,scaleY:1,matrix:[1,0,0,1,0,0],origin:["50%","50%"],reflect:[1,0,0,1,0,0],reflectX:[1,0,0,1,0,0],reflectXY:[1,0,0,1,0,0],reflectY:[1,0,0,1,0,0]});if(typeof(g.cssMultipleValues)=="undefined"){g.cssMultipleValues={}}g.extend(g.cssMultipleValues,{matrix:6,origin:{length:2,duplicate:true},reflect:6,reflectX:6,reflectXY:6,reflectY:6,scale:{length:2,duplicate:true},skew:2,translate:2});g.extend(g.cssNumber,{matrix:true,reflect:true,reflectX:true,reflectXY:true,reflectY:true,scale:true,scaleX:true,scaleY:true});g.each(g.transform.funcs,function(j,k){g.cssHooks[k]={set:function(m,n){var l=m.transform||new g.transform(m),i={};i[k]=n;l.exec(i,{preserve:true})},get:function(m,l){var i=m.transform||new g.transform(m);return i.getAttr(k)}}});g.each(["reflect","reflectX","reflectXY","reflectY"],function(j,k){g.cssHooks[k].get=function(m,l){var i=m.transform||new g.transform(m);return i.getAttr("matrix")||g.cssDefault[k]}})})(jQuery,this,this.document);(function(e,g,h,c){var d=/^([+\-]=)?([\d+.\-]+)(.*)$/;var a=e.fn.animate;e.fn.animate=function(n,k,m,l){var j=e.speed(k,m,l);if(!e.isEmptyObject(n)){if(typeof j.original==="undefined"){j.original={}}e.each(n,function(o,p){if(e.cssMultipleValues[o]||e.cssAngle[o]||(!e.cssNumber[o]&&e.transform.funcs[o])){j.original[o]=p.toString();n[o]=parseFloat(p)}})}return a.apply(this,[arguments[0],j])};var b="paddingBottom";function i(k,l){if(k[l]!=null&&(!k.style||k.style[l]==null)){}var j=parseFloat(e.css(k,l));return j&&j>-10000?j:0}var f=e.fx.prototype.custom;e.fx.prototype.custom=function(v,k,r){var z=e.cssMultipleValues[this.prop],y=e.cssAngle[this.prop];if(z){this.values=[];var j=this.options.original[this.prop],l=e(this.elem).css(this.prop),u=e.cssDefault[this.prop]||0;if(!e.isArray(l)){l=[l]}if(!e.isArray(j)){if(e.type(j)==="string"){j=j.split(",")}else{j=[j]}}var p=z.length||z,x=0;while(j.length<p){j.push(z.duplicate?j[0]:u[x]||0);x++}var q,t,o,n=this,m=e.style(n.elem,b);e.each(j,function(B,C){if(l[B]){q=l[B]}else{if(u[B]&&!z.duplicate){q=u[B]}else{if(z.duplicate){q=l[0]}else{q=0}}}if(y){q=e.angle.toDegree(q)}else{if(!e.cssNumber[n.prop]){t=d.exec(e.trim(q));if(t[3]){e.style(n.elem,b,q);q=i(n.elem,b);e.style(n.elem,b,m)}}else{q=parseFloat(q)}}t=d.exec(e.trim(C));if(t){o=parseFloat(t[2]);r=t[3]||"px";if(y){o=e.angle.toDegree(o+r);r="deg"}else{if(!e.cssNumber[n.prop]&&r!=="px"){e.style(n.elem,b,(o||1)+r);q=((o||1)/i(n.elem,b))*q;e.style(n.elem,b,m)}}if(t[1]){o=((t[1]==="-="?-1:1)*o)+q}}else{o=C;r=""}n.values.push({start:q,end:o,unit:r})})}else{if(y){var A=this.options.original[this.prop],s=e(this.elem).css(this.prop),w=e.cssDefault[this.prop]||0,n=this;v=n.start=e.angle.toDegree(s||w);k=n.end=e.angle.toDegree(A);r=n.unit="deg"}else{if(!e.cssNumber[this.prop]&&e.inArray(this.prop,e.transform.funcs)){var s=e(this.elem).css(this.prop),w=e.cssDefault[this.prop]||0,t,q,n=this,m=e.style(n.elem,b);q=s||w;t=d.exec(q);if(t&&t[3]){e.style(n.elem,b,q);q=i(n.elem,b);e.style(n.elem,b,m)}if(r!=="px"){e.style(n.elem,b,(k||1)+r);q=((k||1)/i(n.elem,b))*q;e.style(n.elem,b,m)}v=n.start=q}}}return f.apply(this,arguments)};e.fx.multipleValueStep={_default:function(j){e.each(j.values,function(k,l){j.values[k].now=l.start+((l.end-l.start)*j.pos)})}};e.each(e.transform.funcs,function(j,k){e.fx.step[k]=function(n){var m=n.elem.transform||new e.transform(n.elem),l={};if(e.cssMultipleValues[k]){(e.fx.multipleValueStep[n.prop]||e.fx.multipleValueStep._default)(n);l[n.prop]=[];e.each(n.values,function(o,p){l[n.prop].push(p.now+(e.cssNumber[n.prop]?"":p.unit))})}else{l[n.prop]=n.now+(e.cssNumber[n.prop]?"":n.unit)}m.exec(l,{preserve:true})}});e.each(["reflect","reflectX","reflectXY","reflectY"],function(k,l){var j=e.fx.step[l];e.fx.step[l]=function(p){var o=p.elem.transform||new e.transform(p.elem),n={};if(!p.initialized){p.start=p.initialized=true;var m=e.matrix[l]().elements;e.each(p.values,function(q){var r;switch(q){case 0:r=m[0];break;case 1:r=m[2];break;case 2:r=m[1];break;case 3:r=m[3];break;default:r=0}p.values[q].end=r;p.initialized=true})}(e.fx.multipleValueStep[p.prop]||e.fx.multipleValueStep._default)(p);n.matrix=[];e.each(p.values,function(q,r){n.matrix.push(r.now)});o.exec(n,{preserve:true})}})})(jQuery,this,this.document);(function(g,h,j,c){var d=180/Math.PI;var k=200/Math.PI;var f=Math.PI/180;var e=2/1.8;var i=0.9;var a=Math.PI/200;var b=/^([+\-]=)?([\d+.\-]+)(.*)$/;g.extend({angle:{runit:/(deg|g?rad)/,radianToDegree:function(l){return l*d},radianToGrad:function(l){return l*k},degreeToRadian:function(l){return l*f},degreeToGrad:function(l){return l*e},gradToDegree:function(l){return l*i},gradToRadian:function(l){return l*a},toDegree:function(m){var l=b.exec(m);if(l){m=parseFloat(l[2]);switch(l[3]||"deg"){case"grad":m=g.angle.gradToDegree(m);break;case"rad":m=g.angle.radianToDegree(m);break}return m}return 0}}})})(jQuery,this,this.document);(function(e,d,b,f){if(typeof(e.matrix)=="undefined"){e.extend({matrix:{}})}e.extend(e.matrix,{V2:function(g,h){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,2)}else{this.elements=[g,h]}this.length=2},V3:function(g,i,h){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,3)}else{this.elements=[g,i,h]}this.length=3},M2x2:function(h,g,j,i){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,4)}else{this.elements=Array.prototype.slice.call(arguments).slice(0,4)}this.rows=2;this.cols=2},M3x3:function(l,k,j,i,h,g,o,n,m){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,9)}else{this.elements=Array.prototype.slice.call(arguments).slice(0,9)}this.rows=3;this.cols=3}});var c={e:function(j,g){var h=this.rows,i=this.cols;if(j>h||g>h||j<1||g<1){return 0}return this.elements[(j-1)*i+g-1]}};e.extend(e.matrix.M2x2.prototype,c,{toM3x3:function(){var g=this.elements;return new e.matrix.M3x3(g[0],g[1],0,g[2],g[3],0,0,0,1)},x:function(i){var j=typeof(i.rows)==="undefined";if(!j&&i.rows==3){return this.toM3x3().x(i)}var h=this.elements,g=i.elements;if(j&&g.length==2){return new e.matrix.V2(h[0]*g[0]+h[1]*g[1],h[2]*g[0]+h[3]*g[1])}else{if(g.length==h.length){return new e.matrix.M2x2(h[0]*g[0]+h[1]*g[2],h[0]*g[1]+h[1]*g[3],h[2]*g[0]+h[3]*g[2],h[2]*g[1]+h[3]*g[3])}}return false},inverse:function(){var h=1/this.determinant(),g=this.elements;return new e.matrix.M2x2(h*g[3],h*-g[1],h*-g[2],h*g[0])},determinant:function(){var g=this.elements;return g[0]*g[3]-g[1]*g[2]}});e.extend(e.matrix.M3x3.prototype,c,{x:function(i){var j=typeof(i.rows)==="undefined";if(!j&&i.rows<3){i=i.toM3x3()}var h=this.elements,g=i.elements;if(j&&g.length==3){return new e.matrix.V3(h[0]*g[0]+h[1]*g[1]+h[2]*g[2],h[3]*g[0]+h[4]*g[1]+h[5]*g[2],h[6]*g[0]+h[7]*g[1]+h[8]*g[2])}else{if(g.length==h.length){return new e.matrix.M3x3(h[0]*g[0]+h[1]*g[3]+h[2]*g[6],h[0]*g[1]+h[1]*g[4]+h[2]*g[7],h[0]*g[2]+h[1]*g[5]+h[2]*g[8],h[3]*g[0]+h[4]*g[3]+h[5]*g[6],h[3]*g[1]+h[4]*g[4]+h[5]*g[7],h[3]*g[2]+h[4]*g[5]+h[5]*g[8],h[6]*g[0]+h[7]*g[3]+h[8]*g[6],h[6]*g[1]+h[7]*g[4]+h[8]*g[7],h[6]*g[2]+h[7]*g[5]+h[8]*g[8])}}return false},inverse:function(){var h=1/this.determinant(),g=this.elements;return new e.matrix.M3x3(h*(g[8]*g[4]-g[7]*g[5]),h*(-(g[8]*g[1]-g[7]*g[2])),h*(g[5]*g[1]-g[4]*g[2]),h*(-(g[8]*g[3]-g[6]*g[5])),h*(g[8]*g[0]-g[6]*g[2]),h*(-(g[5]*g[0]-g[3]*g[2])),h*(g[7]*g[3]-g[6]*g[4]),h*(-(g[7]*g[0]-g[6]*g[1])),h*(g[4]*g[0]-g[3]*g[1]))},determinant:function(){var g=this.elements;return g[0]*(g[8]*g[4]-g[7]*g[5])-g[3]*(g[8]*g[1]-g[7]*g[2])+g[6]*(g[5]*g[1]-g[4]*g[2])}});var a={e:function(g){return this.elements[g-1]}};e.extend(e.matrix.V2.prototype,a);e.extend(e.matrix.V3.prototype,a)})(jQuery,this,this.document);(function(c,b,a,d){if(typeof(c.matrix)=="undefined"){c.extend({matrix:{}})}c.extend(c.matrix,{calc:function(e,f,g){this.matrix=e;this.outerHeight=f;this.outerWidth=g}});c.matrix.calc.prototype={coord:function(e,i,h){h=typeof(h)!=="undefined"?h:0;var g=this.matrix,f;switch(g.rows){case 2:f=g.x(new c.matrix.V2(e,i));break;case 3:f=g.x(new c.matrix.V3(e,i,h));break}return f},corners:function(e,h){var f=!(typeof(e)!=="undefined"||typeof(h)!=="undefined"),g;if(!this.c||!f){h=h||this.outerHeight;e=e||this.outerWidth;g={tl:this.coord(0,0),bl:this.coord(0,h),tr:this.coord(e,0),br:this.coord(e,h)}}else{g=this.c}if(f){this.c=g}return g},sides:function(e){var f=e||this.corners();return{top:Math.min(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),bottom:Math.max(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),left:Math.min(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1)),right:Math.max(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1))}},offset:function(e){var f=this.sides(e);return{height:Math.abs(f.bottom-f.top),width:Math.abs(f.right-f.left)}},area:function(e){var h=e||this.corners();var g={x:h.tr.e(1)-h.tl.e(1)+h.br.e(1)-h.bl.e(1),y:h.tr.e(2)-h.tl.e(2)+h.br.e(2)-h.bl.e(2)},f={x:h.bl.e(1)-h.tl.e(1)+h.br.e(1)-h.tr.e(1),y:h.bl.e(2)-h.tl.e(2)+h.br.e(2)-h.tr.e(2)};return 0.25*Math.abs(g.e(1)*f.e(2)-g.e(2)*f.e(1))},nonAffinity:function(){var f=this.sides(),g=f.top-f.bottom,e=f.left-f.right;return parseFloat(parseFloat(Math.abs((Math.pow(g,2)+Math.pow(e,2))/(f.top*f.bottom+f.left*f.right))).toFixed(8))},originOffset:function(h,g){h=h?h:new c.matrix.V2(this.outerWidth*0.5,this.outerHeight*0.5);g=g?g:new c.matrix.V2(0,0);var e=this.coord(h.e(1),h.e(2));var f=this.coord(g.e(1),g.e(2));return{top:(f.e(2)-g.e(2))-(e.e(2)-h.e(2)),left:(f.e(1)-g.e(1))-(e.e(1)-h.e(1))}}}})(jQuery,this,this.document);(function(c,b,a,d){if(typeof(c.matrix)=="undefined"){c.extend({matrix:{}})}c.extend(c.matrix,{identity:function(g){g=g||2;var h=g*g,j=new Array(h),f=g+1;for(var e=0;e<h;e++){j[e]=(e%f)===0?1:0}return new c.matrix["M"+g+"x"+g](j)},matrix:function(){var e=Array.prototype.slice.call(arguments);switch(arguments.length){case 4:return new c.matrix.M2x2(e[0],e[2],e[1],e[3]);case 6:return new c.matrix.M3x3(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}},reflect:function(){return new c.matrix.M2x2(-1,0,0,-1)},reflectX:function(){return new c.matrix.M2x2(1,0,0,-1)},reflectXY:function(){return new c.matrix.M2x2(0,1,1,0)},reflectY:function(){return new c.matrix.M2x2(-1,0,0,1)},rotate:function(i){var f=c.angle.degreeToRadian(i),h=Math.cos(f),j=Math.sin(f);var g=h,e=j,l=-j,k=h;return new c.matrix.M2x2(g,l,e,k)},scale:function(f,e){f=f||f===0?f:1;e=e||e===0?e:f;return new c.matrix.M2x2(f,0,0,e)},scaleX:function(e){return c.matrix.scale(e,1)},scaleY:function(e){return c.matrix.scale(1,e)},skew:function(h,f){h=h||0;f=f||0;var i=c.angle.degreeToRadian(h),g=c.angle.degreeToRadian(f),e=Math.tan(i),j=Math.tan(g);return new c.matrix.M2x2(1,e,j,1)},skewX:function(e){return c.matrix.skew(e)},skewY:function(e){return c.matrix.skew(0,e)},translate:function(f,e){f=f||0;e=e||0;return new c.matrix.M3x3(1,0,f,0,1,e,0,0,1)},translateX:function(e){return c.matrix.translate(e)},translateY:function(e){return c.matrix.translate(0,e)}})})(jQuery,this,this.document);
+(function(f,g,j,c){var h=/progid:DXImageTransform\.Microsoft\.Matrix\(.*?\)/;var d=j.createElement("modernizr"),e=d.style;function n(m){return parseFloat(m)}function l(){var m={transformProperty:"",MozTransform:"-moz-",WebkitTransform:"-webkit-",OTransform:"-o-",msTransform:"-ms-"};for(var r in m){if(typeof e[r]!="undefined"){return m[r]}}return null}function q(){if(typeof(g.Modernizr)!=="undefined"){return Modernizr.csstransforms}var r=["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"];for(var m in r){if(e[r[m]]!==c){return true}}}var a=l(),i=a!==null?a+"transform":false,k=a!==null?a+"transform-origin":false;f.support.csstransforms=q();if(a=="-ms-"){i="msTransform";k="msTransformOrigin"}f.extend({transform:function(m){m.transform=this;this.$elem=f(m);this.applyingMatrix=false;this.matrix=null;this.height=null;this.width=null;this.outerHeight=null;this.outerWidth=null;this.boxSizingValue=null;this.boxSizingProperty=null;this.attr=null;this.transformProperty=i;this.transformOriginProperty=k}});f.extend(f.transform,{funcs:["matrix","origin","reflect","reflectX","reflectXY","reflectY","rotate","scale","scaleX","scaleY","skew","skewX","skewY","translate","translateX","translateY"],rfunc:{angle:/^rotate|skew[X|Y]?$/,length:/^origin|translate[X|Y]?$/,scale:/^scale[X|Y]?$/,reflect:/^reflect(XY|X|Y)?$/}});f.fn.transform=function(m,r){return this.each(function(){var s=this.transform||new f.transform(this);if(m){s.exec(m,r)}})};f.transform.prototype={exec:function(m,r){r=f.extend(true,{forceMatrix:false,preserve:false},r);this.attr=null;if(r.preserve){m=f.extend(true,this.getAttrs(true,true),m)}else{m=f.extend(true,{},m)}this.setAttrs(m);if(f.support.csstransforms&&!r.forceMatrix){return this.execFuncs(m)}else{if(f.browser.msie||(f.support.csstransforms&&r.forceMatrix)){return this.execMatrix(m)}}return false},execFuncs:function(r){var m=[];for(var s in r){if(s=="origin"){this[s].apply(this,f.isArray(r[s])?r[s]:[r[s]])}else{if(f.inArray(s,f.transform.funcs)!=-1){m.push(this.createTransformFunc(s,r[s]))}}}this.$elem.css(i,m.join(" "));return true},execMatrix:function(t){var F,A,C;var v=this.$elem[0];function s(H){return o(v,H)}for(var w in t){if(f.matrix[w]){switch(f.type(t[w])){case"array":C=t[w];break;case"string":C=f.map(t[w].split(","),f.trim);break;default:C=[t[w]]}if(f.cssAngle[w]){C=f.map(C,f.angle.toDegree)}else{if(!f.cssNumber[w]){C=f.map(C,s)}else{C=f.map(C,n)}}A=f.matrix[w].apply(this,C);F=F?F.x(A):A}else{if(w=="origin"){C=f.isArray(t[w])?t[w]:[t[w]];this[w].apply(this,C)}}}F=F||f.matrix.identity();var G=parseFloat(F.e(1,1).toFixed(6)),E=parseFloat(F.e(2,1).toFixed(6)),D=parseFloat(F.e(1,2).toFixed(6)),B=parseFloat(F.e(2,2).toFixed(6)),y=F.rows===3?parseFloat(F.e(1,3).toFixed(6)):0,x=F.rows===3?parseFloat(F.e(2,3).toFixed(6)):0;if(f.support.csstransforms&&a==="-moz-"){this.$elem.css(i,"matrix("+G+", "+E+", "+D+", "+B+", "+y+"px, "+x+"px)")}else{if(f.support.csstransforms){this.$elem.css(i,"matrix("+G+", "+E+", "+D+", "+B+", "+y+", "+x+")")}else{if(f.browser.msie){var m=", FilterType='nearest neighbor'";var r=this.$elem[0].style;var z="progid:DXImageTransform.Microsoft.Matrix(M11="+G+", M12="+D+", M21="+E+", M22="+B+", sizingMethod='auto expand'"+m+")";var u=r.filter||f.curCSS(this.$elem[0],"filter")||"";r.filter=h.test(u)?u.replace(h,z):u?u+" "+z:z;this.applyingMatrix=true;this.matrix=F;this.fixPosition(F,y,x);this.applyingMatrix=false;this.matrix=null}}}return true},origin:function(m,r){if(f.support.csstransforms){if(typeof r==="undefined"){this.$elem.css(k,m)}else{this.$elem.css(k,m+" "+r)}return true}switch(m){case"left":m="0";break;case"right":m="100%";break;case"center":case c:m="50%"}switch(r){case"top":r="0";break;case"bottom":r="100%";break;case"center":case c:r="50%"}if(/%/.test(m)&&/%/.test(r)){this.setAttr("origin",[m,r]);return true}this.setAttr("origin",[/%/.test(m)?m:parseFloat(m)+"px",/%/.test(r)?r:parseFloat(r)+"px"]);return true},createTransformFunc:function(s,t){if(s.substr(0,7)==="reflect"){var r=t?f.matrix[s]():f.matrix.identity();return"matrix("+r.e(1,1)+", "+r.e(2,1)+", "+r.e(1,2)+", "+r.e(2,2)+", 0, 0)"}if(s=="matrix"){if(a==="-moz-"&&t[4]){t[4]=t[4]?t[4]+"px":0;t[5]=t[5]?t[5]+"px":0}}return s+"("+(f.isArray(t)?t.join(", "):t)+")"},fixPosition:function(z,w,v,B,m){var u=new f.matrix.calc(z,this.safeOuterHeight(),this.safeOuterWidth()),A=this.getAttr("origin");var t=u.originOffset(new f.matrix.V2(/%/.test(A[0])?parseFloat(A[0])/100*u.outerWidth:parseFloat(A[0]),/%/.test(A[1])?parseFloat(A[1])/100*u.outerHeight:parseFloat(A[1])));var r=u.sides();var s=this.$elem.css("position");if(s=="static"){s="relative"}var y={top:0,left:0};var x={position:s,top:(t.top+v+r.top+y.top)+"px",left:(t.left+w+r.left+y.left)+"px",zoom:1};this.$elem.css(x)}};var b=/^([\+\-]=)?([\d+.\-]+)(.*)$/;function o(m,s){var r=b.exec(f.trim(s)),u="paddingBottom",t=f.style(m,u);if(r[3]){f.style(m,u,s);s=p(m,u);f.style(m,u,t);return s}return parseFloat(s)}function p(s,t){if(s[t]!=null&&(!s.style||s.style[t]==null)){return s[t]}var m=parseFloat(f.css(s,t));return m&&m>-10000?m:0}})(jQuery,this,this.document);(function(d,c,a,f){d.extend(d.transform.prototype,{safeOuterHeight:function(){return this.safeOuterLength("height")},safeOuterWidth:function(){return this.safeOuterLength("width")},safeOuterLength:function(l){var o="outer"+(l=="width"?"Width":"Height");if(d.browser.msie){l=l=="width"?"width":"height";if(this.applyingMatrix&&!this[o]&&this.matrix){var k=new d.matrix.calc(this.matrix,1,1),m=k.offset(),g=this.$elem[o]()/m[l];this[o]=g;return g}else{if(this.applyingMatrix&&this[o]){return this[o]}}var n={height:["top","bottom"],width:["left","right"]};var h=this.$elem[0],j=parseFloat(d.curCSS(h,l,true)),p=this.boxSizingProperty,i=this.boxSizingValue;if(!this.boxSizingProperty){p=this.boxSizingProperty=e()||"box-sizing";i=this.boxSizingValue=this.$elem.css(p)||"content-box"}if(this[o]&&this[l]==j){return this[o]}else{this[l]=j}if(p&&(i=="padding-box"||i=="content-box")){j+=parseFloat(d.curCSS(h,"padding-"+n[l][0],true))||0+parseFloat(d.curCSS(h,"padding-"+n[l][1],true))||0}if(p&&i=="content-box"){j+=parseFloat(d.curCSS(h,"border-"+n[l][0]+"-width",true))||0+parseFloat(d.curCSS(h,"border-"+n[l][1]+"-width",true))||0}this[o]=j;return j}return this.$elem[o]()}});var b=null;function e(){if(b){return b}var h={boxSizing:"box-sizing",MozBoxSizing:"-moz-box-sizing",WebkitBoxSizing:"-webkit-box-sizing",OBoxSizing:"-o-box-sizing"},g=a.body;for(var i in h){if(typeof g.style[i]!="undefined"){b=h[i];return b}}return null}})(jQuery,this,this.document);(function(g,f,b,h){var d=/([\w\-]*?)\((.*?)\)/g,a="data-transform",e=/\s/,c=/,\s?/;g.extend(g.transform.prototype,{setAttrs:function(i){var j="",l;for(var k in i){l=i[k];if(g.isArray(l)){l=l.join(", ")}j+=" "+k+"("+l+")"}this.attr=g.trim(j);this.$elem.attr(a,this.attr)},setAttr:function(k,l){if(g.isArray(l)){l=l.join(", ")}var j=this.attr||this.$elem.attr(a);if(!j||j.indexOf(k)>-1){this.attr=g.trim(j+" "+k+"("+l+")");this.$elem.attr(a,this.attr)}else{var i=[],m;d.lastIndex=0;while((result=d.exec(j))!==null){if(k==m[1]){i.push(k+"("+l+")")}else{i.push(m[0])}}this.attr=i.join(" ");this.$elem.attr(a,this.attr)}},getAttrs:function(){var j=this.attr||this.$elem.attr(a);if(!j){return{}}var i={},l,k;d.lastIndex=0;while((l=d.exec(j))!==null){if(l){k=l[2].split(c);i[l[1]]=k.length==1?k[0]:k}}return i},getAttr:function(j){var i=this.getAttrs();if(typeof i[j]!=="undefined"){return i[j]}if(j==="origin"&&g.support.csstransforms){return this.$elem.css(this.transformOriginProperty).split(e)}else{if(j==="origin"){return["50%","50%"]}}return g.cssDefault[j]||0}});if(typeof(g.cssAngle)=="undefined"){g.cssAngle={}}g.extend(g.cssAngle,{rotate:true,skew:true,skewX:true,skewY:true});if(typeof(g.cssDefault)=="undefined"){g.cssDefault={}}g.extend(g.cssDefault,{scale:[1,1],scaleX:1,scaleY:1,matrix:[1,0,0,1,0,0],origin:["50%","50%"],reflect:[1,0,0,1,0,0],reflectX:[1,0,0,1,0,0],reflectXY:[1,0,0,1,0,0],reflectY:[1,0,0,1,0,0]});if(typeof(g.cssMultipleValues)=="undefined"){g.cssMultipleValues={}}g.extend(g.cssMultipleValues,{matrix:6,origin:{length:2,duplicate:true},reflect:6,reflectX:6,reflectXY:6,reflectY:6,scale:{length:2,duplicate:true},skew:2,translate:2});g.extend(g.cssNumber,{matrix:true,reflect:true,reflectX:true,reflectXY:true,reflectY:true,scale:true,scaleX:true,scaleY:true});g.each(g.transform.funcs,function(j,k){g.cssHooks[k]={set:function(m,n){var l=m.transform||new g.transform(m),i={};i[k]=n;l.exec(i,{preserve:true})},get:function(m,l){var i=m.transform||new g.transform(m);return i.getAttr(k)}}});g.each(["reflect","reflectX","reflectXY","reflectY"],function(j,k){g.cssHooks[k].get=function(m,l){var i=m.transform||new g.transform(m);return i.getAttr("matrix")||g.cssDefault[k]}})})(jQuery,this,this.document);(function(e,g,h,c){var d=/^([+\-]=)?([\d+.\-]+)(.*)$/;var a=e.fn.animate;e.fn.animate=function(n,k,m,l){var j=e.speed(k,m,l);if(!e.isEmptyObject(n)){if(typeof j.original==="undefined"){j.original={}}e.each(n,function(o,p){if(e.cssMultipleValues[o]||e.cssAngle[o]||(!e.cssNumber[o]&&e.inArray(o,e.transform.funcs))){j.original[o]=p.toString();n[o]=parseFloat(p)}})}return a.apply(this,[arguments[0],j])};var b="paddingBottom";function i(k,l){if(k[l]!=null&&(!k.style||k.style[l]==null)){}var j=parseFloat(e.css(k,l));return j&&j>-10000?j:0}var f=e.fx.prototype.custom;e.fx.prototype.custom=function(t,u,v){var x=e.cssMultipleValues[this.prop],n=e.cssAngle[this.prop];if(x||(!e.cssNumber[this.prop]&&e.inArray(this.prop,e.transform.funcs))){this.values=[];if(!x){x=1}var w=this.options.original[this.prop],r=e(this.elem).css(this.prop),j=e.cssDefault[this.prop]||0;if(!e.isArray(r)){r=[r]}if(!e.isArray(w)){if(e.type(w)==="string"){w=w.split(",")}else{w=[w]}}var l=x.length||x,q=0;while(w.length<l){w.push(x.duplicate?w[0]:j[q]||0);q++}var k,p,o,m=this,s=e.style(m.elem,b);e.each(w,function(y,z){if(r[y]){k=r[y]}else{if(j[y]&&!x.duplicate){k=j[y]}else{if(x.duplicate){k=r[0]}else{k=0}}}if(n){k=e.angle.toDegree(k)}else{if(!e.cssNumber[m.prop]){p=d.exec(e.trim(k));if(p[3]){e.style(m.elem,b,k);k=i(m.elem,b);e.style(m.elem,b,s)}}else{k=parseFloat(k)}}p=d.exec(e.trim(z));if(p){o=parseFloat(p[2]);v=p[3]||"px";if(n){o=e.angle.toDegree(o+v);v="deg"}else{if(!e.cssNumber[m.prop]&&v!=="px"){e.style(m.elem,b,(o||1)+v);k=((o||1)/i(m.elem,b))*k;e.style(m.elem,b,s)}}if(p[1]){o=((p[1]==="-="?-1:1)*o)+k}}else{o=z;v=""}m.values.push({start:k,end:o,unit:v})})}return f.apply(this,arguments)};e.fx.multipleValueStep={_default:function(j){e.each(j.values,function(k,l){j.values[k].now=l.start+((l.end-l.start)*j.pos)})}};e.each(e.transform.funcs,function(j,k){e.fx.step[k]=function(n){var m=n.elem.transform||new e.transform(n.elem),l={};if(e.cssMultipleValues[k]||(!e.cssNumber[k]&&e.inArray(k,e.transform.funcs))){(e.fx.multipleValueStep[n.prop]||e.fx.multipleValueStep._default)(n);l[n.prop]=[];e.each(n.values,function(o,p){l[n.prop].push(p.now+(e.cssNumber[n.prop]?"":p.unit))})}else{l[n.prop]=n.now+(e.cssNumber[n.prop]?"":n.unit)}m.exec(l,{preserve:true})}});e.each(["reflect","reflectX","reflectXY","reflectY"],function(k,l){var j=e.fx.step[l];e.fx.step[l]=function(p){var o=p.elem.transform||new e.transform(p.elem),n={};if(!p.initialized){p.start=p.initialized=true;var m=e.matrix[l]().elements;e.each(p.values,function(q){var r;switch(q){case 0:r=m[0];break;case 1:r=m[2];break;case 2:r=m[1];break;case 3:r=m[3];break;default:r=0}p.values[q].end=r;p.initialized=true})}(e.fx.multipleValueStep[p.prop]||e.fx.multipleValueStep._default)(p);n.matrix=[];e.each(p.values,function(q,r){n.matrix.push(r.now)});o.exec(n,{preserve:true})}})})(jQuery,this,this.document);(function(g,h,j,c){var d=180/Math.PI;var k=200/Math.PI;var f=Math.PI/180;var e=2/1.8;var i=0.9;var a=Math.PI/200;var b=/^([+\-]=)?([\d+.\-]+)(.*)$/;g.extend({angle:{runit:/(deg|g?rad)/,radianToDegree:function(l){return l*d},radianToGrad:function(l){return l*k},degreeToRadian:function(l){return l*f},degreeToGrad:function(l){return l*e},gradToDegree:function(l){return l*i},gradToRadian:function(l){return l*a},toDegree:function(m){var l=b.exec(m);if(l){m=parseFloat(l[2]);switch(l[3]||"deg"){case"grad":m=g.angle.gradToDegree(m);break;case"rad":m=g.angle.radianToDegree(m);break}return m}return 0}}})})(jQuery,this,this.document);(function(e,d,b,f){if(typeof(e.matrix)=="undefined"){e.extend({matrix:{}})}e.extend(e.matrix,{V2:function(g,h){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,2)}else{this.elements=[g,h]}this.length=2},V3:function(g,i,h){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,3)}else{this.elements=[g,i,h]}this.length=3},M2x2:function(h,g,j,i){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,4)}else{this.elements=Array.prototype.slice.call(arguments).slice(0,4)}this.rows=2;this.cols=2},M3x3:function(l,k,j,i,h,g,o,n,m){if(e.isArray(arguments[0])){this.elements=arguments[0].slice(0,9)}else{this.elements=Array.prototype.slice.call(arguments).slice(0,9)}this.rows=3;this.cols=3}});var c={e:function(j,g){var h=this.rows,i=this.cols;if(j>h||g>h||j<1||g<1){return 0}return this.elements[(j-1)*i+g-1]}};e.extend(e.matrix.M2x2.prototype,c,{toM3x3:function(){var g=this.elements;return new e.matrix.M3x3(g[0],g[1],0,g[2],g[3],0,0,0,1)},x:function(i){var j=typeof(i.rows)==="undefined";if(!j&&i.rows==3){return this.toM3x3().x(i)}var h=this.elements,g=i.elements;if(j&&g.length==2){return new e.matrix.V2(h[0]*g[0]+h[1]*g[1],h[2]*g[0]+h[3]*g[1])}else{if(g.length==h.length){return new e.matrix.M2x2(h[0]*g[0]+h[1]*g[2],h[0]*g[1]+h[1]*g[3],h[2]*g[0]+h[3]*g[2],h[2]*g[1]+h[3]*g[3])}}return false},inverse:function(){var h=1/this.determinant(),g=this.elements;return new e.matrix.M2x2(h*g[3],h*-g[1],h*-g[2],h*g[0])},determinant:function(){var g=this.elements;return g[0]*g[3]-g[1]*g[2]}});e.extend(e.matrix.M3x3.prototype,c,{x:function(i){var j=typeof(i.rows)==="undefined";if(!j&&i.rows<3){i=i.toM3x3()}var h=this.elements,g=i.elements;if(j&&g.length==3){return new e.matrix.V3(h[0]*g[0]+h[1]*g[1]+h[2]*g[2],h[3]*g[0]+h[4]*g[1]+h[5]*g[2],h[6]*g[0]+h[7]*g[1]+h[8]*g[2])}else{if(g.length==h.length){return new e.matrix.M3x3(h[0]*g[0]+h[1]*g[3]+h[2]*g[6],h[0]*g[1]+h[1]*g[4]+h[2]*g[7],h[0]*g[2]+h[1]*g[5]+h[2]*g[8],h[3]*g[0]+h[4]*g[3]+h[5]*g[6],h[3]*g[1]+h[4]*g[4]+h[5]*g[7],h[3]*g[2]+h[4]*g[5]+h[5]*g[8],h[6]*g[0]+h[7]*g[3]+h[8]*g[6],h[6]*g[1]+h[7]*g[4]+h[8]*g[7],h[6]*g[2]+h[7]*g[5]+h[8]*g[8])}}return false},inverse:function(){var h=1/this.determinant(),g=this.elements;return new e.matrix.M3x3(h*(g[8]*g[4]-g[7]*g[5]),h*(-(g[8]*g[1]-g[7]*g[2])),h*(g[5]*g[1]-g[4]*g[2]),h*(-(g[8]*g[3]-g[6]*g[5])),h*(g[8]*g[0]-g[6]*g[2]),h*(-(g[5]*g[0]-g[3]*g[2])),h*(g[7]*g[3]-g[6]*g[4]),h*(-(g[7]*g[0]-g[6]*g[1])),h*(g[4]*g[0]-g[3]*g[1]))},determinant:function(){var g=this.elements;return g[0]*(g[8]*g[4]-g[7]*g[5])-g[3]*(g[8]*g[1]-g[7]*g[2])+g[6]*(g[5]*g[1]-g[4]*g[2])}});var a={e:function(g){return this.elements[g-1]}};e.extend(e.matrix.V2.prototype,a);e.extend(e.matrix.V3.prototype,a)})(jQuery,this,this.document);(function(c,b,a,d){if(typeof(c.matrix)=="undefined"){c.extend({matrix:{}})}c.extend(c.matrix,{calc:function(e,f,g){this.matrix=e;this.outerHeight=f;this.outerWidth=g}});c.matrix.calc.prototype={coord:function(e,i,h){h=typeof(h)!=="undefined"?h:0;var g=this.matrix,f;switch(g.rows){case 2:f=g.x(new c.matrix.V2(e,i));break;case 3:f=g.x(new c.matrix.V3(e,i,h));break}return f},corners:function(e,h){var f=!(typeof(e)!=="undefined"||typeof(h)!=="undefined"),g;if(!this.c||!f){h=h||this.outerHeight;e=e||this.outerWidth;g={tl:this.coord(0,0),bl:this.coord(0,h),tr:this.coord(e,0),br:this.coord(e,h)}}else{g=this.c}if(f){this.c=g}return g},sides:function(e){var f=e||this.corners();return{top:Math.min(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),bottom:Math.max(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),left:Math.min(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1)),right:Math.max(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1))}},offset:function(e){var f=this.sides(e);return{height:Math.abs(f.bottom-f.top),width:Math.abs(f.right-f.left)}},area:function(e){var h=e||this.corners();var g={x:h.tr.e(1)-h.tl.e(1)+h.br.e(1)-h.bl.e(1),y:h.tr.e(2)-h.tl.e(2)+h.br.e(2)-h.bl.e(2)},f={x:h.bl.e(1)-h.tl.e(1)+h.br.e(1)-h.tr.e(1),y:h.bl.e(2)-h.tl.e(2)+h.br.e(2)-h.tr.e(2)};return 0.25*Math.abs(g.e(1)*f.e(2)-g.e(2)*f.e(1))},nonAffinity:function(){var f=this.sides(),g=f.top-f.bottom,e=f.left-f.right;return parseFloat(parseFloat(Math.abs((Math.pow(g,2)+Math.pow(e,2))/(f.top*f.bottom+f.left*f.right))).toFixed(8))},originOffset:function(h,g){h=h?h:new c.matrix.V2(this.outerWidth*0.5,this.outerHeight*0.5);g=g?g:new c.matrix.V2(0,0);var e=this.coord(h.e(1),h.e(2));var f=this.coord(g.e(1),g.e(2));return{top:(f.e(2)-g.e(2))-(e.e(2)-h.e(2)),left:(f.e(1)-g.e(1))-(e.e(1)-h.e(1))}}}})(jQuery,this,this.document);(function(c,b,a,d){if(typeof(c.matrix)=="undefined"){c.extend({matrix:{}})}c.extend(c.matrix,{identity:function(g){g=g||2;var h=g*g,j=new Array(h),f=g+1;for(var e=0;e<h;e++){j[e]=(e%f)===0?1:0}return new c.matrix["M"+g+"x"+g](j)},matrix:function(){var e=Array.prototype.slice.call(arguments);switch(arguments.length){case 4:return new c.matrix.M2x2(e[0],e[2],e[1],e[3]);case 6:return new c.matrix.M3x3(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}},reflect:function(){return new c.matrix.M2x2(-1,0,0,-1)},reflectX:function(){return new c.matrix.M2x2(1,0,0,-1)},reflectXY:function(){return new c.matrix.M2x2(0,1,1,0)},reflectY:function(){return new c.matrix.M2x2(-1,0,0,1)},rotate:function(i){var f=c.angle.degreeToRadian(i),h=Math.cos(f),j=Math.sin(f);var g=h,e=j,l=-j,k=h;return new c.matrix.M2x2(g,l,e,k)},scale:function(f,e){f=f||f===0?f:1;e=e||e===0?e:f;return new c.matrix.M2x2(f,0,0,e)},scaleX:function(e){return c.matrix.scale(e,1)},scaleY:function(e){return c.matrix.scale(1,e)},skew:function(h,f){h=h||0;f=f||0;var i=c.angle.degreeToRadian(h),g=c.angle.degreeToRadian(f),e=Math.tan(i),j=Math.tan(g);return new c.matrix.M2x2(1,e,j,1)},skewX:function(e){return c.matrix.skew(e)},skewY:function(e){return c.matrix.skew(0,e)},translate:function(f,e){f=f||0;e=e||0;return new c.matrix.M3x3(1,0,f,0,1,e,0,0,1)},translateX:function(e){return c.matrix.translate(e)},translateY:function(e){return c.matrix.translate(0,e)}})})(jQuery,this,this.document);
View
51 dist/jquery.transform.js
@@ -6,7 +6,7 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: Sun Oct 24 23:27:27 2010 -0700
+ * Date: Sun Nov 7 23:14:31 2010 -0800
*/
///////////////////////////////////////////////////////
// Transform
@@ -800,7 +800,7 @@
$.each( prop, function( name, val ) {
if ($.cssMultipleValues[name]
|| $.cssAngle[name]
- || (!$.cssNumber[name] && $.transform.funcs[name])) {
+ || (!$.cssNumber[name] && $.inArray(name, $.transform.funcs))) {
// force the original values onto the optall
optall.original[name] = val.toString();
@@ -829,10 +829,15 @@
$.fx.prototype.custom = function(from, to, unit) {
var multiple = $.cssMultipleValues[this.prop],
angle = $.cssAngle[this.prop];
-
- if (multiple) {
+
+ //TODO: simply check for the existence of CSS Hooks?
+ if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs))) {
this.values = [];
+ if (!multiple) {
+ multiple = 1;
+ }
+
// Pull out the known values
var values = this.options.original[this.prop],
currentValues = $(this.elem).css(this.prop),
@@ -924,42 +929,6 @@
unit: unit
});
});
- } else if (angle) {
- var val = this.options.original[this.prop],
- currentVal = $(this.elem).css(this.prop),
- defaultVal = $.cssDefault[this.prop] || 0,
- fx = this;
-
- // normalize start on degrees
- from = fx.start = $.angle.toDegree(currentVal || defaultVal);
-
- // normalize end on degrees
- to = fx.end = $.angle.toDegree(val);
-
- //change units to degrees
- unit = fx.unit = 'deg';
- } else if (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs)) {
- var currentVal = $(this.elem).css(this.prop),
- defaultVal = $.cssDefault[this.prop] || 0,
- parts, start, fx = this,
- orig = $.style(fx.elem, prop);
-
- // normalize start to pixels
- start = currentVal || defaultVal;
- parts = rfxnum.exec(start);
- if (parts && parts[3]) {
- $.style( fx.elem, prop, start);
- start = cur(fx.elem, prop);
- $.style( fx.elem, prop, orig);
- }
-
- // convert the start units to the end units
- if (unit !== 'px') {
- $.style( fx.elem, prop, (to || 1) + unit);
- start = ((to || 1) / cur(fx.elem, prop)) * start;
- $.style( fx.elem, prop, orig);
- }
- from = fx.start = start;
}
return _custom.apply(this, arguments);
};
@@ -985,7 +954,7 @@
var transform = fx.elem.transform || new $.transform(fx.elem),
funcs = {};
- if ($.cssMultipleValues[func]) {
+ if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs))) {
($.fx.multipleValueStep[fx.prop] || $.fx.multipleValueStep._default)(fx);
funcs[fx.prop] = [];
$.each(fx.values, function(i, val) {
View
49 src/jquery.transform.animate.js
@@ -28,7 +28,7 @@
$.each( prop, function( name, val ) {
if ($.cssMultipleValues[name]
|| $.cssAngle[name]
- || (!$.cssNumber[name] && $.transform.funcs[name])) {
+ || (!$.cssNumber[name] && $.inArray(name, $.transform.funcs))) {
// force the original values onto the optall
optall.original[name] = val.toString();
@@ -57,10 +57,15 @@
$.fx.prototype.custom = function(from, to, unit) {
var multiple = $.cssMultipleValues[this.prop],
angle = $.cssAngle[this.prop];
-
- if (multiple) {
+
+ //TODO: simply check for the existence of CSS Hooks?
+ if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs))) {
this.values = [];
+ if (!multiple) {
+ multiple = 1;
+ }
+
// Pull out the known values
var values = this.options.original[this.prop],
currentValues = $(this.elem).css(this.prop),
@@ -152,42 +157,6 @@
unit: unit
});
});
- } else if (angle) {
- var val = this.options.original[this.prop],
- currentVal = $(this.elem).css(this.prop),
- defaultVal = $.cssDefault[this.prop] || 0,
- fx = this;
-
- // normalize start on degrees
- from = fx.start = $.angle.toDegree(currentVal || defaultVal);
-
- // normalize end on degrees
- to = fx.end = $.angle.toDegree(val);
-
- //change units to degrees
- unit = fx.unit = 'deg';
- } else if (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs)) {
- var currentVal = $(this.elem).css(this.prop),
- defaultVal = $.cssDefault[this.prop] || 0,
- parts, start, fx = this,
- orig = $.style(fx.elem, prop);
-
- // normalize start to pixels
- start = currentVal || defaultVal;
- parts = rfxnum.exec(start);
- if (parts && parts[3]) {
- $.style( fx.elem, prop, start);
- start = cur(fx.elem, prop);
- $.style( fx.elem, prop, orig);
- }
-
- // convert the start units to the end units
- if (unit !== 'px') {
- $.style( fx.elem, prop, (to || 1) + unit);
- start = ((to || 1) / cur(fx.elem, prop)) * start;
- $.style( fx.elem, prop, orig);
- }
- from = fx.start = start;
}
return _custom.apply(this, arguments);
};
@@ -213,7 +182,7 @@
var transform = fx.elem.transform || new $.transform(fx.elem),
funcs = {};
- if ($.cssMultipleValues[func]) {
+ if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs))) {
($.fx.multipleValueStep[fx.prop] || $.fx.multipleValueStep._default)(fx);
funcs[fx.prop] = [];
$.each(fx.values, function(i, val) {
View
80 test/test3.html
@@ -82,11 +82,11 @@
<script>
(function ($) {
- var $elem = $('.transform'),
+ var $elem = $('.transform:last'),
$text = $('#text'),
$result = $('#result'),
$step = $('#step'),
- current = 99,
+ current = -1,
auto = false;
//$('#go').click(go);
@@ -614,15 +614,87 @@
}, {complete: function() {$result.text($elem.attr('data-transform'));}});
},
function () {
- $text.text('Animate: TranslateY using em');
+ $text.text('Animate: TranslateY using ex');
$elem.animate({
translateY: '3ex'
}, {complete: function() {$result.text($elem.attr('data-transform'));}});
},
function () {
+ $text.text('Animate: TranslateY using em');
+ $elem.animate({
+ translateY: '4em'
+ }, {complete: function() {$result.text($elem.attr('data-transform'));}});
+ },
+ function () {
+ $text.text('Reset');
+ $elem.transform({});
+ },
+
+ // Origin
+ function () {
+ $text.text('Transform: Origin with one value');
+ $elem.transform({rotate: '45deg', origin: '25px'});
+ },
+ function () {
+ $text.text('CSS: Origin with one value');
+ $elem.css({rotate: '45deg', origin: '50px'});
+ },
+ function () {
+ $text.text('Transform: Origin with two values');
+ $elem.transform({rotate: '45deg', origin: '25px, 50px'});
+ },
+ function () {
+ $text.text('CSS: Origin with two values');
+ $elem.css({rotate: '45deg', origin: '50px, 50px'});
+ },
+ function () {
+ $text.text('Transform: Origin with two values as array');
+ $elem.transform({rotate: '45deg', origin: ['75px', '50px']});
+ },
+ function () {
+ $text.text('CSS: Origin with two values as array');
+ $elem.css({rotate: '45deg', origin: ['75px', '75px']});
+ },
+ function () {
+ $text.text('Animate: Origin with one value');
+ $elem.animate({
+ rotate: '45deg', origin: '50px'
+ }, {complete: function() {$result.text($elem.attr('data-transform'));}});
+ },
+ function () {
+ $text.text('Animate: Origin with two values');
+ $elem.animate({
+ rotate: '45deg', origin: '75px, 25px'
+ }, {complete: function() {$result.text($elem.attr('data-transform'));}});
+ },
+ function () {
+ $text.text('Animate: Origin with two values as array (per-property conflict)');
+ $elem.animate({
+ rotate: '45deg', origin: ['50px', '75px']
+ }, {complete: function() {$result.text($elem.attr('data-transform'));}});
+ },
+ function () {
+ $text.text('Animate: Origin with two values as nested array');
+ $elem.animate({
+ rotate: '45deg', origin: [['75px', '50px']]
+ }, {complete: function() {$result.text($elem.attr('data-transform'));}});
+ },
+ function () {
+ $text.text('Animate: Origin with two values as nested array using em for first value');
+ $elem.animate({
+ rotate: '45deg', origin: [['7.5em', '75px']]
+ }, {complete: function() {$result.text($elem.attr('data-transform'));}});
+ },
+ function () {
+ $text.text('Animate: Origin with two values as nested array using pt for first value and percentage for the second value');
+ $elem.animate({
+ rotate: '45deg', origin: [['100pt', '75%']]
+ }, {complete: function() {$result.text($elem.attr('data-transform'));}});
+ },
+ function () {
$text.text('Reset');
$elem.transform({});
- }
+ },
]
if (tests[current]) {

0 comments on commit a7ffd6c

Please sign in to comment.