简体   繁体   English

SVG动画不能在firefox上运行

[英]SVG animation not working on firefox

I am trying to use this animation 我正在尝试使用这个动画

http://codepen.io/dbj/full/epXEyd http://codepen.io/dbj/full/epXEyd

var tl = new TimelineLite;
tl.staggerFromTo(".bottom", 0.8, {alpha: 0}, {alpha: 1, fill: "#d6d6d6", delay: 1}, 0.25)
tl.fromTo("#rectangle", 5, {fill:"#d6d6d6", alpha: "0%", height: "7%"}, {fill: "#c8db2d", alpha: "100%", height: "65%", ease: Power3.easeInOut}, "-=1")
tl.staggerFromTo(".ray", 1, {alpha: 0}, {alpha: 1, fill: "#cee325"}, 0.02, "-=1.25")

in a website but it doesn't seem fully compatible with Firefox browser (on chrome it works perfectly), is there any way I can make it work for all browsers? 在一个网站,但它似乎与Firefox浏览器不完全兼容(在Chrome上运行完美),有什么方法可以让它适用于所有浏览器?

I tried to change the javascript calls to the animation libraries, using from instead of fromTo etc, everything works fine in chrome but not in firefox. 我尝试将javascript调用更改为动画库,使用from而不是fromTo等,一切都在chrome中工作正常,但在firefox中没有。 (or if someone know other similar animation i could use it would be nice too :D). (或者,如果有人知道其他类似的动画,我可以使用它也会很好:D)。 Thanks a lot! 非常感谢!

If I had to guess, I'd say it is an issue with the animation library you are using. 如果我不得不猜测,我会说这是你正在使用的动画库的一个问题。

In the animation, it is attempting to animate the height of a <rect> element to give that rising fill effect. 在动画中,它试图为<rect>元素的高度设置动画,以提供上升的填充效果。 Note the height 7%->66% transition in the code below. 请注意以下代码中的高度7% - > 66%转换。

.fromTo("#rectangle", 7, {fill:"#000", alpha: "0%", height: "7%"}, {fill: "#f5e317", alpha: "100%", height: "66%", ease: Power3.easeInOut}, "-=1")

The height of the rectangle is not actually changing while the animation is running. 动画运行时,矩形的高度实际上没有变化。 So I suspect it may be a bug or incompatibility in the way the animation library is setting the height during the animation. 因此我怀疑动画库在动画期间设置高度的方式可能是错误或不兼容。

Cut down demo: http://codepen.io/anon/pen/Vjadwm 减少演示: http//codepen.io/anon/pen/Vjadwm

If you get no answers here, I would consider asking Greensock for help, or posting a bug report with them. 如果你在这里没有得到答案,我会考虑向Greensock寻求帮助,或者向他们发布错误报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM