jQuery插件的跨浏览器css兼容性 [英] jQuery plugin for cross browser css compatibility

查看:205
本文介绍了jQuery插件的跨浏览器css兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,用户可以更改元素的边框样式属性,如半径,颜色,宽度,样式等。

In my app users will be able to change element's border style attributes like radius, color, width, style etc.

现在我还需要能够这些属性与jQuery,但是为了得到像border-radius,你需要使用 css(border-top-left-radius)版本的firefox和chrome),这将不工作在所有浏览器,所以我的问题是:

Now I also need to be able to get these attributes with jQuery, however in order to get something like border-radius, you need to use css("border-top-left-radius") (at least in new versions of firefox and chrome) and this will not work in all browsers, so my question is:

有一个插件添加正确的前缀到CSS选择器例如webkit,moz等,并且还可以使这些css功能在设置这些属性时兼容跨浏览器?

$ b

推荐答案

-prefix-free 作者: Lea Verou 提供 jQuery插件,它简单地将-prefix自由脚本本身与jQuery的 .css()方法集成。

-prefix-free by Lea Verou offers a jQuery plugin that simply integrates the -prefix-free script itself with jQuery's .css() method.

所有脚本本身都是在适当的地方添加供应商前缀到CSS属性,所以你不必。它不会做任何其他像polyfills。

All the script itself does is add vendor prefixes to CSS properties where appropriate so you don't have to. It doesn't do anything else like polyfills.

这篇关于jQuery插件的跨浏览器css兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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