CSS3 IE tween support
This commit is contained in:
@@ -16,9 +16,10 @@ provides: [Fx.Tween]
|
|||||||
Element.NativeEvents.transitionend = 2;
|
Element.NativeEvents.transitionend = 2;
|
||||||
Element.NativeEvents.webkitTransitionEnd = 2;
|
Element.NativeEvents.webkitTransitionEnd = 2;
|
||||||
Element.NativeEvents.oTransitionEnd = 2;
|
Element.NativeEvents.oTransitionEnd = 2;
|
||||||
|
Element.NativeEvents.msTransitionEnd = 2;
|
||||||
|
|
||||||
Element.Events.transitionend = {
|
Element.Events.transitionend = {
|
||||||
base: Browser.safari || Browser.chrome ? 'webkitTransitionEnd' : (Browser.opera ? 'oTransitionEnd' : 'transitionend')
|
base: Browser.safari || Browser.chrome ? 'webkitTransitionEnd' : (Browser.opera ? 'oTransitionEnd' : (Browser.ie && Browser.version > 8 ? 'msTransitionEnd' : 'transitionend'))
|
||||||
};
|
};
|
||||||
|
|
||||||
Event.implement({
|
Event.implement({
|
||||||
@@ -37,12 +38,12 @@ Element.implement({
|
|||||||
|
|
||||||
supportStyle: function(style){
|
supportStyle: function(style){
|
||||||
var value = this.style[style];
|
var value = this.style[style];
|
||||||
return !!(value || value == '');
|
return !!(value || value === '');
|
||||||
},
|
},
|
||||||
|
|
||||||
supportVendorStyle: function(style){
|
supportVendorStyle: function(style){
|
||||||
var prefixedStyle = null;
|
var prefixedStyle = null;
|
||||||
return this.supportStyle(style) ? style : ['webkit', 'Moz', 'o'].some(function(prefix){
|
return this.supportStyle(style) ? style : ['webkit', 'Moz', 'o', 'ms'].some(function(prefix){
|
||||||
prefixedStyle = prefix + style.capitalize();
|
prefixedStyle = prefix + style.capitalize();
|
||||||
return this.supportStyle(prefixedStyle);
|
return this.supportStyle(prefixedStyle);
|
||||||
}, this) ? prefixedStyle : null;
|
}, this) ? prefixedStyle : null;
|
||||||
@@ -107,21 +108,21 @@ Fx.Tween = new Class({
|
|||||||
if (event.getPropertyName() == this.property /* && event.getElapsedTime() == this.options.duration */ ){
|
if (event.getPropertyName() == this.property /* && event.getElapsedTime() == this.options.duration */ ){
|
||||||
this.element.removeEvent('transitionend', this.boundComplete);
|
this.element.removeEvent('transitionend', this.boundComplete);
|
||||||
this.boundComplete = null;
|
this.boundComplete = null;
|
||||||
this.fireEvent('complete', this.subject);
|
this.fireEvent('complete', this);
|
||||||
}
|
}
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
this.element.addEvent('transitionend', this.boundComplete);
|
this.element.addEvent('transitionend', this.boundComplete);
|
||||||
var trans = function(){
|
var trans = function(){
|
||||||
this.element.setStyle(this.transition, this.property + ' ' + this.options.duration + 'ms cubic-bezier(' + this.transitionTimings[this.options.transition] + ')');
|
this.element.setStyle(this.transition, this.property + ' ' + this.options.duration + 'ms cubic-bezier(' + this.transitionTimings[this.options.transition] + ')');
|
||||||
this.element.setStyle(this.property, this.to[0].value + + this.options.unit);
|
this.element.setStyle(this.property, this.to[0].value + this.options.unit);
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
if (args[1]){
|
if (args[1]){
|
||||||
this.element.setStyle(this.transition, 'none');
|
this.element.setStyle(this.transition, 'none');
|
||||||
this.element.setStyle(this.property, this.from[0].value + + this.options.unit);
|
this.element.setStyle(this.property, this.from[0].value + this.options.unit);
|
||||||
trans.delay(0.1);
|
trans.delay(0.1);
|
||||||
} else
|
} else
|
||||||
trans();
|
trans();
|
||||||
this.fireEvent('start', this.subject);
|
this.fireEvent('start', this);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
return this.parent(property, from, to);
|
return this.parent(property, from, to);
|
||||||
@@ -137,4 +138,4 @@ Fx.Tween = new Class({
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user