I've experienced some issues animating background position. As usual everything is perfect in Webkit
I only care about IE9+, FF, Chrome, Safari.
TweenMax.fromTo($('#rain-' + i), 1,
{css:{'background-position': ""+rainHeight+"px 0px"}},
{css:{'background-position': ""+(-rainHeight)+"px 0px"}, repeat: -1, delay:offset, repeatDelay: 0, ease: Linear.easeNone }
);
This animates the position of a css linear gradient.
It works on everything except Firefox, Firefox just does nothing.
However this.... (with camel cased keys)
TweenMax.fromTo($('#rain-' + i), 1,
{css:{backgroundPosition: ""+rainHeight+"px 0px"}},
{css:{backgroundPosition: ""+(-rainHeight)+"px 0px"}, repeat: -1, delay:offset, repeatDelay: 0, ease: Linear.easeNone }
);
...works fine in Firefox, but causes an invalid argument error in IE10 (it's fine in IE9)
SCRIPT87: Invalid argument
TweenMax.min.js line 16, character 20973
For the time being I have implemented the following special case which is grim.
if (document.all && window.atob) {
// Firefox breaks with 'background-position'
// IE10 breaks with 'backgroundPosition'
// bodge to workaround
TweenMax.fromTo($('#rain-' + i), 1,
{css:{'background-position': ""+rainHeight+"px 0px"}},
{css:{'background-position': ""+(-rainHeight)+"px 0px"}, repeat: -1, delay:offset, repeatDelay: 0, ease: Linear.easeNone }
);
} else {
TweenMax.fromTo($('#rain-' + i), 1,
{css:{backgroundPosition: ""+rainHeight+"px 0px"}},
{css:{backgroundPosition: ""+(-rainHeight)+"px 0px"}, repeat: -1, delay:offset, repeatDelay: 0, ease: Linear.easeNone }
);
}
Any suggestions? Is this something that can be fixed in TweenMax?