简体   繁体   English

CSS3或jQuery / JavaScript动画,哪一个更兼容?

[英]CSS3 or jQuery/JavaScript animations,which one is more compatible?

So I know now CSS3 is a lot faster than jQuery, but I want to know how CSS3 is spread nowadays, is it wide-spread? 所以我知道现在CSS3比jQuery快得多,但我想知道CSS3现在如何传播,它是否广泛传播? I believe jQuery is better this way because, you can animate CSS2 with it as well, so older browsers show animation, but if there are only a few people using older browsers I don't think I should use jQuery, or maybe there is a solution that my app will recognize whether the browser supports css3 or not, and if not, it tries to run the animation with jQuery/JavaScript? 我相信jQuery这种方式更好,因为你也可以用它来动画CSS2,所以旧的浏览器会显示动画,但是如果只有少数人使用旧的浏览器,我认为我不应该使用jQuery,或者可能有一个我的应用程序将识别浏览器是否支持css3的解决方案,如果没有,它会尝试使用jQuery / JavaScript运行动画?

jQuery Transit lets you create CSS animations with classic jQuery syntax and can fallback to js animations on unsupported browsers jQuery Transit允许您使用经典的jQuery语法创建CSS动画,并可以在不支持的浏览器上回退到js动画

Basically the problem is IE < 10, so you could consider just using css animations with no fallback; 基本上问题是IE <10,所以你可以考虑使用没有后退的css动画; animations can be considered progressive enhancement and not having them on some browsers doesn't jeopardize user experience that much. 动画可以被认为是渐进式增强,而在某些浏览器上没有这些动画并不会危及用户体验。 On top of that IE<9 has poor javascript performance so the fallback js animations wouldn't be so pleasant anyway. 最重要的是,IE <9的javascript性能很差,所以无论如何,后备js动画都不会那么令人愉快。

Use jQuery if you want the most compatibility. 如果您想要最兼容,请使用jQuery。 A lot of people still use old browsers such as Internet Explorer 8, which doesn't have the CSS3 support. 很多人仍然使用旧的浏览器,如Internet Explorer 8,它没有CSS3支持。

From MSDN : 来自MSDN

Microsoft Internet Explorer 6 was the first fully Cascading Style Sheets, Level 1 (CSS1)-compliant version of Internet Explorer. Microsoft Internet Explorer 6是第一个完全级联样式表,符合Level 1(CSS1)的Internet Explorer版本。 Windows Internet Explorer 8 is fully compliant with the Cascading Style Sheets, Level 2 Revision 1 (CSS2.1) specification and supports some features of Cascading Style Sheets, Level 3 (CSS3). Windows Internet Explorer 8完全符合层叠样式表,2级修订版1(CSS2.1)规范,并支持层叠样式表3级(CSS3)的一些功能。 Windows Internet Explorer 9 and Internet Explorer 10 add even more support for many CSS3 modules. Windows Internet Explorer 9和Internet Explorer 10为许多CSS3模块添加了更多支持。

JQuery is supported provided you have the libraries included, but not all the animations CSS is supported by all browsers. 如果您包含库,则支持JQuery,但并非所有动画都支持所有浏览器的CSS。

CSS browser compatibly CSS浏览器兼容

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

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