|
|
@ -101,6 +101,10 @@ $.fn.transition = function() { |
|
|
|
|
|
|
|
animate: function(overrideSettings) { |
|
|
|
settings = overrideSettings || settings; |
|
|
|
if(!module.is.supported()) { |
|
|
|
module.error(error.support); |
|
|
|
return false; |
|
|
|
} |
|
|
|
module.debug('Preparing animation', settings.animation); |
|
|
|
if(module.is.animating()) { |
|
|
|
if(settings.queue) { |
|
|
@ -120,7 +124,7 @@ $.fn.transition = function() { |
|
|
|
if(!module.has.direction() && module.can.transition()) { |
|
|
|
module.set.direction(); |
|
|
|
} |
|
|
|
if(!module.can.animate()) { |
|
|
|
if(!module.has.transitionAvailable) { |
|
|
|
module.restore.conditions(); |
|
|
|
module.error(error.noAnimation); |
|
|
|
return false; |
|
|
@ -172,6 +176,16 @@ $.fn.transition = function() { |
|
|
|
if( $module.hasClass(className.inward) || $module.hasClass(className.outward) ) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
}, |
|
|
|
transitionAvailable: function() { |
|
|
|
if($module.css(animationName) !== 'none') { |
|
|
|
module.debug('CSS definition found'); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else { |
|
|
|
module.debug('Unable to find css definition'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -332,7 +346,7 @@ $.fn.transition = function() { |
|
|
|
; |
|
|
|
for(animation in animations){ |
|
|
|
if( element.style[animation] !== undefined ){ |
|
|
|
module.verbose('Determining animation vendor name property', animations[animation]); |
|
|
|
module.verbose('Determined animation vendor name property', animations[animation]); |
|
|
|
return animations[animation]; |
|
|
|
} |
|
|
|
} |
|
|
@ -352,7 +366,7 @@ $.fn.transition = function() { |
|
|
|
; |
|
|
|
for(animation in animations){ |
|
|
|
if( element.style[animation] !== undefined ){ |
|
|
|
module.verbose('Determining animation vendor end event', animations[animation]); |
|
|
|
module.verbose('Determined animation vendor end event', animations[animation]); |
|
|
|
return animations[animation]; |
|
|
|
} |
|
|
|
} |
|
|
@ -362,16 +376,6 @@ $.fn.transition = function() { |
|
|
|
}, |
|
|
|
|
|
|
|
can: { |
|
|
|
animate: function() { |
|
|
|
if($module.css(animationName) !== 'none') { |
|
|
|
module.debug('CSS definition found'); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else { |
|
|
|
module.debug('Unable to find css definition'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
transition: function() { |
|
|
|
var |
|
|
|
$clone = $('<div>').addClass( $module.attr('class') ).appendTo($('body')), |
|
|
@ -400,6 +404,9 @@ $.fn.transition = function() { |
|
|
|
}, |
|
|
|
visible: function() { |
|
|
|
return $module.is(':visible'); |
|
|
|
}, |
|
|
|
supported: function() { |
|
|
|
return(animationName !== false && animationEnd !== false); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -645,7 +652,8 @@ $.fn.transition.settings = { |
|
|
|
// possible errors
|
|
|
|
error: { |
|
|
|
noAnimation : 'There is no css animation matching the one you specified.', |
|
|
|
method : 'The method you called is not defined' |
|
|
|
method : 'The method you called is not defined', |
|
|
|
support : 'This browser does not support CSS animations' |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|