角动画在IE Edge中不起作用 [英] Angular animation not working in IE edge

查看:89
本文介绍了角动画在IE Edge中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Angular的组件中添加了动画.但是,动画在Chrome和Firefox中效果不错,但在IE Edge中,虽然样式在状态更改时正确应用,但没有指定的动画,但不会触发动画.

I added an animation to my component in Angular. However the animation WORKS FINE in Chrome and Firefox, but in IE Edge the animation is NOT triggerd although the styles are applied correctly on state change, but just without specified animation.

有人有同样的问题吗?

这是我的代码:

animations: [
    trigger('rowState', [
        state('collapsed', style({
            'height': 0,
            'overflow-y': 'hidden'
        })),
        state('expanded', style({
            'height': '*',
            'overflow-y': 'hidden'
        })),
        transition('collapsed <=> expanded', [animate('1000ms ease-out')])
    ])
]

预先感谢

推荐答案

edge中不支持网络动画,您应该添加 polyfill

角度动画是在标准Web动画API的基础上构建的,并且可以在支持它的浏览器上本地运行. 对于其他浏览器,需要使用polyfill.从GitHub上获取 web-animations.min.js 并将其添加到您的页面.

Angular animations are built on top of the standard Web Animations API and run natively on browsers that support it. For other browsers, a polyfill is required. Grab web-animations.min.js from GitHub and add it to your page.

这篇关于角动画在IE Edge中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆