Browse files

starting on patching animate

  • Loading branch information...
1 parent c4ffa06 commit 2414182433c3f4b5cb3367d89af7339aebf7ddce unknown committed May 16, 2010
Showing with 19 additions and 9 deletions.
  1. +19 −9 lib/transform.js
View
28 lib/transform.js
@@ -80,6 +80,18 @@
};
// Extend the jQuery animation to handle transform function
+ var _animate = $.fn.animate;
+ $.fn.animate = function( prop, speed, easing, callback ) {
+ var style = this[0].style;
+ jQuery.each( prop, function( name, val ) {
+ // clean up the numbers for multivalue properties we care about
+ if ($.inArray(transformFuncs, name)) {
+ console.log(style[name] === undefined);
+ }
+ });
+ return _animate.apply(this, arguments);
+ }
+
/**
* Detects the existence of a space separated value
* @param Boolean force
@@ -92,10 +104,8 @@
if (rfxmultinum.test(value)) {
value = value.split(/\s/)[0];
}
- if (unitless.test(this.prop) && !value && value !== 0) {
- value = 1;
- } else if (!value && value !== 0) {
- value = 0;
+ if (!value && value !== 0) {
+ value = unitless.test(this.prop) ? 1 : 0;
}
return parseFloat(value);
}
@@ -161,19 +171,19 @@
$.fx.step[attr] = function(fx) {
// Initialize the transformation
if (!fx.transformInit) {
+ console.log(fx.options.curAnim);
fx.transform = new Transform(fx.elem);
// Correct for start being NaN
if (isNaN(fx.start)) {
- //console.log(fx);
fx.start = fx.transform.getAttribute(fx.prop, true);
if ($.isArray(fx.start)) {
fx.start = fx.start[0];
}
- var end = fx.end;
- if (/\s/.test(fx.end)) {
- var end = fx.end.split(/\s/)[0];
- }
+ //var end = fx.end;
+ //if (/\s/.test(fx.end)) {
+ // end = fx.end.split(/\s/)[0];
+ //}
fx.now = fx.start + ((fx.end - fx.start) * fx.pos);
}

0 comments on commit 2414182

Please sign in to comment.