animation.type = 'none';
}
var defaultParams = {};
- var globalDefault = {x: 0, y: 0, yoyo: 0, repeat: 0};
+ var globalDefault = {x: 0, y: 0, yoyo: 0, repeat: 0, transformorigin: '50% 50%'};
var w = parseFloat(link.css('width'));
var cx = w / 2;
var h = parseFloat(link.css('height'));
if (animation.delay !== undefined) {
to.delay = parseFloat(animation.delay);
}
- if (animation.type === 'translatefrom') {
+ if (animation.type === 'scalefrom') {
+ to.display = 'block';
+ to.visibility = 'visible';
+
+ from.scale = animation.scale;
+ to.scale = 1;
+ from.transformOrigin = to.transformOrigin = animation.transformorigin;
+ } else if (animation.type === 'scale') {
+ to.display = 'block';
+ to.visibility = 'visible';
+
+ from.scale = 1;
+ to.scale = animation.scale;
+ from.transformOrigin = to.transformOrigin = animation.transformorigin;
+ } else if (animation.type === 'translatefrom') {
from.display = 'none';
to.display = 'block';
- to.visibility='visible';
+ to.visibility = 'visible';
from.x = animation.x;
from.y = animation.y;
} else if (animation.type === 'translate') {
from.display = 'none';
to.display = 'block';
- to.visibility='visible';
+ to.visibility = 'visible';
from.x = 0;
from.y = 0;
to.x = animation.x;
} else if (animation.type === 'zoomin' || animation.type === 'zoomout') {
var s = (100 * animation.scale) + "%";
- from.backgroundPosition = to.backgroudPosition = '50% 50%';
+ from.backgroundPosition = to.backgroudPosition = animation.transformorigin;
from.backgroundSize = animation.type === 'zoomin' ? '100% 100%' : s + ' ' + s;
to.backgroundSize = animation.type === 'zoomout' ? '100% 100%' : s + ' ' + s;
- to.visibility='visible';
+ to.visibility = 'visible';
if (Modernizr.firefox) {
to.force3D = true;
to.rotation = 0.01;
} else if (animation.type === 'fadein') {
from.display = 'none';
to.display = 'block';
- to.visibility='visible';
+ to.visibility = 'visible';
from.opacity = 0;
to.opacity = 1;
} else if (animation.type === 'fadeout') {
if (animation.type === 'reveal') {
from.display = 'none';
to.display = 'block';
- to.visibility='visible';
+ to.visibility = 'visible';
}
var top = 0;