本文介绍了CSS3过渡Polyfill的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以大多数人会熟悉CSS3 Transitions,我喜欢它以上的jQuery动画,因为它有CSS的简单。我唯一的遗憾是,它不工作在IE& 9(一如既往) 4, 4等。我不是在JavaScript中为IE编写单独的动画。但我想要一个解决方案,扫描CSS,抓住动画的速度,哪些属性必须动画,并动画他们(使用jQuery,或其他),是有这样一个解决方案,如果这是什么,在哪里可以我获得它?

Alright, so most of you will be familiar with CSS3 Transitions, I prefer it above jQuery animations as it has the simplicity of CSS. My only regret is that it doesn't work in IE < 9( As always ) as well as Firefox < 4, Safari < 4, etc. I do not mean writing separate animations in JavaScript just for IE. But I want a solution that will scan the CSS, grab the speed of the animations, which properties have to be animated, and animate them ( using jQuery, or something else ), is there such a solution if so what is it and where can I obtain it ?

推荐答案

只要您事先知道哪些浏览器供应商的前缀你需要嗅探。我已为此机制撰写了一个提示:

It is possible to detect supported CSS properties, provided you're aware in advance of what browser vendor prefixes you need to sniff for. I've written a gist for the mechanism:

cssSandpaper是一个JS库,旨在解析CSS并动态实现各种CSS3效果的polyfills:

cssSandpaper is a JS library that aims to parse CSS and dynamically implement polyfills for various CSS3 effects:

还有一个jQuery库,它以相反的顺序运行,并且当调用$时,可以静默地实现转换。 animate():

There is also a jQuery library that operates in reverse order, and silently implements transitions where possible when you call $.animate():

这篇关于CSS3过渡Polyfill的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 09:24