animation.type = 'none';
}
var defaultParams = {};
- var globalDefault = {x: 0, y: 0, yoyo: 0, repeatdelay: 0, repeat: 0, transformorigin: '50% 50%'};
+ var globalDefault = {
+ x: 0,
+ y: 0,
+ yoyo: 0,
+ repeatdelay: 0,
+ repeat: 0,
+ transformorigin: '50% 50%',
+ preventflickering: 0
+ };
if ($(linkElement).hasClass('textLink')) {
globalDefault.transformorigin = '0 100%';
css.textAlign = animation.align;
}
if (animation.scale && ['scale', 'scalefrom', 'zoomin', 'zoomout'].indexOf(animation.type) === -1) {
- css.transform = 'scale(' + animation.scale + ')';
- css.transformOrigin = animation.transformorigin;
+ if (animation.preventflickering) {
+ css.backgroundSize = '100% 100%';
+ css.backgroundPosition = animation.transformorigin;
+ } else {
+ css.transform = 'scale(' + animation.scale + ')';
+ css.transformOrigin = animation.transformorigin;
+ }
}
if (animation.letterspacing) {
} else if (animation.type === 'zoomin' || animation.type === 'zoomout') {
to.display = 'block';
to.visibility = 'visible';
-
+ animatedElement = $(linkElement).find('img,div.img');
from.scale = animation.type === 'zoomin' ? 1 : animation.scale;
to.scale = animation.type === 'zoomout' ? 1 : animation.scale;
- animatedElement = $(linkElement).find('img,div.img');
from.transformOrigin = to.transformOrigin = animation.transformorigin;
+ if (animation.preventflickering == 1) {
+ from.backgroundSize = from.scale * 100 + '% ' + from.scale * 100 + '%';
+ to.backgroundSize = to.scale * 100 + '% ' + to.scale * 100 + '%';
+ from.backgroundPosition = animation.transformorigin;
+ to.transformOrigin = from.transformOrigin = '50% 50%';
+ to.scale = from.scale = 1;
+ }
} else if (animation.type === 'fadein') {
from.display = 'none';
to.display = 'block';