transition-native.js revision 180299c76d681ab191124f34fa2bb9b3e1ef33bf
/**
* The Native Transition Utility provides an API wrapper for CSS transitions.
* It is also the base module for the timer-based transition module.
* @module node
*/
/**
* Provides the base Transition class.
*
* @module node
* @submodule transition-native
*/
/**
* A class for constructing transition instances.
* @class Transition
* @for Transition
* @constructor
* @extends Base
*/
var START = 'transition:start',
END = 'transition:end',
PROPERTY_END = 'transition:propertyEnd',
TRANSITION = '-webkit-transition',
TRANSITION_CAMEL = 'WebkitTransition',
TRANSITION_PROPERTY = '-webkit-transition-property',
TRANSITION_DURATION = '-webkit-transition-duration',
TRANSITION_TIMING_FUNCTION = '-webkit-transition-timing-function',
TRANSITION_END = 'webkitTransitionEnd',
Transition = function() {
};
Transition.useNative = false;
Transition.useNative = true;
}
Transition.prototype = {
this._totalDuration = 0;
this._running = false;
return this;
},
var attrs = {},
attr;
}
}
}
},
/**
* Starts or an animation.
* @method run
* @chainable
*/
run: function() {
var anim = this,
attr;
}
return anim;
},
_start: function() {
this._runNative();
},
if (dur > this._totalDuration) {
this._totalDuration = dur;
}
return dur + 's';
},
_runNative: function(time) {
var transitions = {},
anim = this,
cssText = '',
val,
dur,
attr;
val = transition;
}
if (typeof val === 'function') {
}
}
}
if (!anim._hasEndEvent) {
anim._hasEndEvent = true;
}
});
}
setTimeout(function() { // allow any style init to occur (setStyle, etc)
}, 0);
},
_onNativeEnd: function(e) {
anim = this,
});
});
}
},
destroy: function() {
this.detachAll();
this._node = null;
}
};
Y.Transition = Transition;
/**
Animate one or more css properties to a given value.
<pre>example usage:
Y.one('#demo').transition({
duration: 1, // seconds
easing: 'ease-out',
height: '10px',
width: '10px',
value: 0,
duration: 2,
easing: 'ease-in'
}
});
</pre>
@for node
@method transition
@param {Object} An object containing one or more style properties, a duration and an easing.
@chainable
*/
new Transition(this, config);
return this;
};